service

package
v0.0.0-...-ab627d6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Bot     = 0
	GOODBYE = "我下线了,稍后再来提问吧~"
)

Variables

View Source
var SystemMessage = openai.ChatCompletionMessage{Role: "system", Content: config.BotDesc}

Functions

func AuthorizeUser

func AuthorizeUser(username, password string) (string, error)

func CreateChatCompletion

func CreateChatCompletion(ctx *gin.Context, messages []openai.ChatCompletionMessage) (string, error)

CreateChatCompletion 对话补全

func DeleteConversation

func DeleteConversation(id string) error

DeleteConversation 删除对话

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 NewDialContext(socks5 string) (dialContextFunc, error)

func NewMessage

func NewMessage(ctx *gin.Context, conversationID, userID interface{}, content string) error

NewMessage 新建消息

func ShowConversation

func ShowConversation(id string, userID interface{}) ([]model.Conversation, model.Conversation, error)

ShowConversation 获取对话详情

func UpdateConversation

func UpdateConversation(id, userID interface{}, name string) error

UpdateConversation 更新对话信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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