Documentation
¶
Index ¶
- Constants
- Variables
- func IsLocalDevOrigin(origin string) bool
- func MustHeartbeatAckMsg() string
- func MustJSONRPCWSResMsg(id string, ok bool, err string) string
- func NewLocalDevWebSocketUpgrader() websocket.Upgrader
- type ChatBody
- type ClientWSMessage
- type ConnectParams
- type CreateSessionBody
- type HeartbeatAckBody
- type JSONRPCWSReq
- type JSONRPCWSResBody
- type SubscribeParams
- type ToolApprovalParams
- type UserMessageBroadcast
- type UserMessageContent
- type UserMessageInput
Constants ¶
View Source
const ( TypeUserMessage = "user_message" TypeHeartbeat = "heartbeat" MethodConnect = "connect" MethodSubscribe = "subscribe" MethodSend = "send" MethodToolApproval = "tool_approval" MethodRecreateAgent = "recreate_agent" MethodHeartbeat = TypeHeartbeat MsgFromUserMessage = "user.message" JSONRPCResType = "res" MsgFromServer = "server" MsgFromWSErr = "error" HeartbeatAckType = "heartbeat_ack" )
Variables ¶
View Source
var ( ErrSessionIDRequired = errors.New("session_id is required") ErrChatBodyEmpty = errors.New("text or content required") )
Functions ¶
func IsLocalDevOrigin ¶
func MustHeartbeatAckMsg ¶
func MustHeartbeatAckMsg() string
Types ¶
type ChatBody ¶
type ChatBody struct {
SessionID string `json:"session_id"`
Content string `json:"content"`
Text string `json:"text"`
Parts []agenttypes.MessagePart `json:"parts,omitempty"`
Attachments []dinopkg.UserAttachment `json:"attachments,omitempty"`
}
type ClientWSMessage ¶
type ClientWSMessage struct {
Type string `json:"type"`
Data json.RawMessage `json:"data"`
}
type ConnectParams ¶
type CreateSessionBody ¶
type CreateSessionBody struct {
SessionID string `json:"session_id"`
Config *dino.Config `json:"config"`
}
func ParseCreateSessionBody ¶
func ParseCreateSessionBody(c *gin.Context) (CreateSessionBody, error)
type HeartbeatAckBody ¶
type HeartbeatAckBody struct {
Type string `json:"type"`
}
type JSONRPCWSReq ¶
type JSONRPCWSReq struct {
Type string `json:"type"`
ID string `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params"`
}
type JSONRPCWSResBody ¶
type SubscribeParams ¶
type SubscribeParams struct {
SessionID string `json:"session_id"`
}
type ToolApprovalParams ¶
type UserMessageBroadcast ¶
type UserMessageBroadcast struct {
Type string `json:"type"`
Event string `json:"event"`
Role string `json:"role"`
SessionID string `json:"session_id"`
Payload UserMessageContent `json:"payload"`
}
type UserMessageContent ¶
type UserMessageContent struct {
Content string `json:"content"`
Text string `json:"text,omitempty"`
Parts []agenttypes.MessagePart `json:"parts,omitempty"`
Attachments []dinopkg.UserAttachment `json:"attachments,omitempty"`
}
type UserMessageInput ¶
type UserMessageInput struct {
Content string `json:"content,omitempty"`
Text string `json:"text,omitempty"`
Parts []agenttypes.MessagePart `json:"parts,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.