Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatGPT ¶
func (*ChatGPT) CreateCompletion ¶
func (c *ChatGPT) CreateCompletion(param CompletionRequest) (res CompletionResponse, err error)
func (*ChatGPT) DeleteConversation ¶
type CompletionRequest ¶
type CompletionRequest struct { Action string `json:"action"` // 消息类型 目前只支持next Messages []CompletionRequestMessage `json:"messages"` // 消息内容 Model string `json:"model"` // 消息模型 text-davinci-002-render-sha ParentMessageID string `json:"parent_message_id,omitempty"` // 父消息ID ConversationID string `json:"conversation_id,omitempty"` // 会话ID }
type CompletionRequestMessage ¶
type CompletionRequestMessage struct { ID string `json:"id"` // 消息ID Role string `json:"role"` // 消息角色 user system assistant Content CompletionMessageContent `json:"content"` // 消息内容 }
request
type CompletionResponse ¶
type CompletionResponse struct { ConversationID string `json:"conversation_id"` // 会话ID Error string `json:"error"` // 错误信息 Message CompletionResponseMessage `json:"message"` // 消息内容 }
type CompletionResponseMessage ¶
type CompletionResponseMessage struct { ID string `json:"id"` // 消息ID Author CompletionResponseMessageAuthor `json:"author"` // 消息角色 user system assistant CreateTime float64 `json:"create_time"` // 创建时间 UpdateTime float64 `json:"update_time"` // 更新时间 Content CompletionMessageContent `json:"content"` // 消息内容 EndTurn bool `json:"end_turn"` // 是否结束会话 Weight float64 `json:"weight"` // 权重 MetaData map[string]interface{} `json:"meta_data"` // meta_data Recipient string `json:"recipient"` // 接收者 }
type CompletionResponseMessageAuthor ¶
type CompletionResponseMessageAuthor struct { Role string `json:"role"` // 消息角色 user system assistant Name string `json:"name"` // 角色名称 MetaData map[string]interface{} `json:"meta_data"` // meta_data }
response
Click to show internal directories.
Click to hide internal directories.