Documentation ¶
Index ¶
Constants ¶
View Source
const ( ID = "coze" Comment = "easy to share coze bots/workflow" RoutePrefix = "/" DefaultEnable = false )
Variables ¶
View Source
var Module = module.Module{ ID: ID, Comment: Comment, RouteFunc: AddRoute, RoutePrefix: RoutePrefix, FlagFunc: ServeFlag, }
Functions ¶
Types ¶
type CozeResponse ¶
type CozeResponse struct { Messages []Message `json:"messages"` ConversationID string `json:"conversation_id"` Code int `json:"code"` Msg string `json:"msg"` }
CozeResponse 定义接口返回结构
type Message ¶
type Message struct { Role string `json:"role"` Type string `json:"type"` Content string `json:"content"` ContentType string `json:"content_type"` }
Message 定义消息结构
type RequestPayload ¶
type RequestPayload struct { UserID string `json:"user_id" form:"user_id" binding:"required"` BotID string `json:"bot_id" form:"bot_id" binding:"required"` Prompt string `json:"prompt" form:"prompt" binding:"required"` ConversationID string `json:"conversation_id" form:"conversation_id"` }
RequestPayload 定义接收的请求数据结构
type ResponseContent ¶
type ResponseContent struct { Code int `json:"code"` Content string `json:"content"` ConversationID string `json:"conversation_id"` }
ResponseContent 定义返回的数据结构
Click to show internal directories.
Click to hide internal directories.