Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentController ¶
type AgentController struct {
// contains filtered or unexported fields
}
func NewAgentController ¶
func NewAgentController(logger *zap.Logger, agentService services.AgentService) *AgentController
func (*AgentController) ListAgents ¶
func (c *AgentController) ListAgents(ctx echo.Context) error
ListAgents godoc
@Summary List all agents
@Description Retrieves a list of all agents.
@Tags agents
@Produce json
@Success 200 {array} entities.Agent "Successfully retrieved list of agents"
@Failure 500 {object} map[string]any "Internal server error"
@Router /api/agents [get]
func (*AgentController) RegisterRoutes ¶
func (c *AgentController) RegisterRoutes(e *echo.Group)
RegisterRoutes registers all agent-related routes with Echo
type ChatController ¶
type ChatController struct {
// contains filtered or unexported fields
}
func NewChatController ¶
func NewChatController(logger *zap.Logger, chatService services.ChatService) *ChatController
func (*ChatController) CreateChat ¶
func (c *ChatController) CreateChat(ctx echo.Context) error
CreateChat godoc
@Summary Create a new chat
@Description Creates a new chat with the provided information.
@Tags chats
@Accept json
@Produce json
@Param request body CreateChatRequest true "Chat information to create"
@Success 201 {object} entities.Chat "Successfully created chat"
@Failure 400 {object} map[string]any "Invalid request body"
@Failure 500 {object} map[string]any "Internal server error"
@Router /api/chats [post]
func (*ChatController) GetChat ¶
func (c *ChatController) GetChat(ctx echo.Context) error
GetChat godoc
@Summary Get a chat by ID
@Description Retrieves a chat's information by its ID.
@Tags chats
@Produce json
@Param id path string true "Chat ID"
@Success 200 {object} entities.Chat "Successfully retrieved chat"
@Failure 400 {object} map[string]any "Invalid chat ID"
@Failure 404 {object} map[string]any "Chat not found"
@Failure 500 {object} map[string]any "Internal server error"
@Router /api/chats/{id} [get]
func (*ChatController) ListChats ¶
func (c *ChatController) ListChats(ctx echo.Context) error
ListChats godoc
@Summary List all chats
@Description Retrieves a list of all chats.
@Tags chats
@Produce json
@Success 200 {array} entities.Chat "Successfully retrieved list of chats"
@Failure 500 {object} map[string]any "Internal server error"
@Router /api/chats [get]
func (*ChatController) RegisterRoutes ¶
func (c *ChatController) RegisterRoutes(e *echo.Group)
RegisterRoutes registers all chat-related routes with Echo
func (*ChatController) SendMessage ¶
func (c *ChatController) SendMessage(ctx echo.Context) error
SendMessage godoc
@Summary Send a message to a chat
@Description Sends a new message to a chat.
@Tags chats
@Accept json
@Produce json
@Param id path string true "Chat ID"
@Param request body SendMessageRequest true "Message to send"
@Success 200 {object} SendMessageResponse "Successfully sent message"
@Failure 400 {object} map[string]any "Invalid request body or chat ID"
@Failure 404 {object} map[string]any "Chat not found"
@Failure 500 {object} map[string]any "Internal server error"
@Router /api/chats/{id}/messages [post]
type CreateChatRequest ¶
type CreateChatRequest struct {
AgentID string `json:"agent_id" example:"60d0ddb0f0a4a729c0a8e9b1"`
Name string `json:"name" example:"My Chat"`
}
CreateChatRequest represents the request body for creating a new chat.
type SendMessageRequest ¶
type SendMessageRequest struct {
Role string `json:"role" example:"user"`
Message string `json:"message" example:"Hello, how are you?"`
}
SendMessageRequest represents the request body for sending a message.
type SendMessageResponse ¶
type SendMessageResponse struct {
Role string `json:"role" example:"assistant"`
Message string `json:"message" example:"I'm fine, thank you!"`
}
SendMessageResponse represents the request body for sending a message.
Click to show internal directories.
Click to hide internal directories.