Documentation
¶
Index ¶
- Constants
- Variables
- func AuthorizeUser(username, password string) (string, error)
- func CreateChatCompletion(ctx *gin.Context, messages []openai.ChatCompletionMessage) (string, error)
- func DeleteConversation(id string) error
- func DeleteMessages(conversationID, userID interface{}) error
- func ListConversation(userID interface{}) ([]model.Conversation, model.Conversation, error)
- func NewConversation(userID interface{}, name string) (model.Conversation, error)
- func NewDialContext(socks5 string) (dialContextFunc, error)
- func NewMessage(ctx *gin.Context, conversationID, userID interface{}, content string) error
- func ShowConversation(id string, userID interface{}) ([]model.Conversation, model.Conversation, error)
- func UpdateConversation(id, userID interface{}, name string) error
Constants ¶
View Source
const ( Bot = 0 GOODBYE = "我下线了,稍后再来提问吧~" )
Variables ¶
View Source
var SystemMessage = openai.ChatCompletionMessage{Role: "system", Content: config.BotDesc}
Functions ¶
func AuthorizeUser ¶
func CreateChatCompletion ¶
func CreateChatCompletion(ctx *gin.Context, messages []openai.ChatCompletionMessage) (string, error)
CreateChatCompletion 对话补全
func DeleteMessages ¶
func DeleteMessages(conversationID, userID interface{}) error
DeleteMessages 清除消息记录
func ListConversation ¶
func ListConversation(userID interface{}) ([]model.Conversation, model.Conversation, error)
ListConversation 对话列表
func NewConversation ¶
func NewConversation(userID interface{}, name string) (model.Conversation, error)
NewConversation 新建对话
func NewDialContext ¶
func NewMessage ¶
NewMessage 新建消息
func ShowConversation ¶
func ShowConversation(id string, userID interface{}) ([]model.Conversation, model.Conversation, error)
ShowConversation 获取对话详情
func UpdateConversation ¶
UpdateConversation 更新对话信息
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.