messagetransport

package
v0.0.0-...-435fad9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

messagetransport handles HTTP requests and responses for chat operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatMessageResponse

type ChatMessageResponse struct {
	ID        uuid.UUID `json:"id"`
	ThreadID  uuid.UUID `json:"threadId"`
	Role      string    `json:"role"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"createdAt"`
}

type MessageHandler

type MessageHandler struct {
	// contains filtered or unexported fields
}

MessageHandler handles chat-related HTTP requests.

func NewMessageHandler

func NewMessageHandler(messsageService *messagebusiness.MessageService) *MessageHandler

NewMessageHandler creates a new ChatHandler.

func (*MessageHandler) CreateMessage

func (mh *MessageHandler) CreateMessage(c *gin.Context)

CreateMessage handles creating a new message in a chat thread.

func (*MessageHandler) CreateThread

func (mh *MessageHandler) CreateThread(c *gin.Context)

CreateThread handles the creation of a new chat thread.

func (*MessageHandler) DeleteThread

func (mh *MessageHandler) DeleteThread(c *gin.Context)

DeleteThread handles the deletion of a chat thread.

func (*MessageHandler) GetAllThreads

func (mh *MessageHandler) GetAllThreads(c *gin.Context)

GetAllThreads handles the retrieval of all chat threads for a specific user.

func (*MessageHandler) GetMessagesByThreadID

func (mh *MessageHandler) GetMessagesByThreadID(c *gin.Context)

GetMessagesByThreadID handles retrieving messages for a specific thread with pagination.

func (*MessageHandler) GetThreadByID

func (mh *MessageHandler) GetThreadByID(c *gin.Context)

GetThreadByID handles retrieving a single chat thread by its ID.

type ThreadPayload

type ThreadPayload struct {
	Title string `json:"title"`
	Model string `json:"model"`
}

type ThreadResponse

type ThreadResponse struct {
	ID        uuid.UUID `json:"id"`
	Title     string    `json:"title"`
	Model     string    `json:"model"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL