Documentation ¶
Index ¶
- Variables
- func AskChatGpt(ctx *robot.Ctx, messages []openai.ChatCompletionMessage, ...) (answer string, err error)
- func AskChatGptWithImage(ctx *robot.Ctx, prompt string, delay ...time.Duration) (b64 string, err error)
- type ApiKey
- type ApiProxy
- type ChatRoom
- type GptModel
- type SensitiveWords
- type SystemRoles
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoKey = fmt.Errorf("请先私聊机器人配置apiKey\n") ErrMaxTokens = errors.New("上下文长度限制为4097个词组,您的上下文长度已超出限制") ErrExceededQuota = errors.New("配额已用完,请联系管理员") ErrIncorrectKey = errors.New("ApiKey错误,请联系管理员") )
View Source
var SystemRole = ordermap.NewOrderMap()
Functions ¶
Types ¶
type ApiKey ¶
type ApiKey struct {
Key string `gorm:"column:key;index"`
}
ApiKey 表名:apikey,存放openai key
type ChatRoom ¶
type ChatRoom struct {
// contains filtered or unexported fields
}
ChatRoom chatRoomCtx -> ChatRoom => 维系每个人的上下文
type GptModel ¶
type GptModel struct { Model string `gorm:"column:model"` MaxTokens int `gorm:"column:max_tokens"` Temperature float64 `gorm:"column:temperature"` TopP float64 `gorm:"column:top_p"` PresencePenalty float64 `gorm:"column:presence_penalty"` FrequencyPenalty float64 `gorm:"column:frequency_penalty"` ImageSize string `gorm:"column:image_size"` }
GptModel 表名:gptmodel,存放gpt模型相关配置参数
type SensitiveWords ¶
type SensitiveWords struct { Type int `gorm:"column:type;index"` // 1:内置敏感词,2:自定义敏感词 Word string `gorm:"column:word;index"` // 敏感词 Deleted int `gorm:"column:deleted;index"` // 0:未删除,1:已删除 }
SensitiveWords 表名:sensitive,存放敏感词
type SystemRoles ¶
SystemRoles 表名:roles,存放系统角色
Click to show internal directories.
Click to hide internal directories.