http

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Status int    `json:"status"`
	Msg    string `json:"msg"`
}

ErrorResponse defines the structure for error responses

type Handler

type Handler interface {
	GetMessageRequest(c *gin.Context) (*MessageRequest, error)
	ChatAPI(c *gin.Context, engine *engine.AgentEngine, req *MessageRequest)
	StreamChatAPI(c *gin.Context, engine *engine.AgentEngine, req *MessageRequest)
}

func NewHandler

func NewHandler() Handler

type MessageRequest

type MessageRequest struct {
	SessionID        string `json:"session_id" binding:"required,min=1"`
	types.AgentInput `json:"message" binding:"required,min=1"`
}

MessageRequest defines the structure for message requests

type SSEvent

type SSEvent struct {
	Type    string      `json:"type"`
	Content string      `json:"content,omitempty"`
	Error   string      `json:"error,omitempty"`
	End     bool        `json:"end,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

SSEvent defines the structure for SSE events

Jump to

Keyboard shortcuts

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