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指令:set chatgpt apikey __(多个key用;符号隔开)\napiKey获取请到https://beta.openai.com获取") ErrMaxTokens = errors.New("OpenAi免费上下文长度限制为4097个词组,您的上下文长度已超出限制") ErrExceededQuota = errors.New("OpenAi配额已用完,请联系管理员") ErrIncorrectKey = errors.New("OpenAi ApiKey错误,请联系管理员") )
View Source
var SystemRole = ordermap.NewOrderMap()
Functions ¶
Types ¶
type ApiKey ¶ added in v1.0.11
type ApiKey struct {
Key string `gorm:"column:key;index"`
}
ApiKey 表名:apikey,存放openai key
type ChatRoom ¶ added in v1.4.7
type ChatRoom struct {
// contains filtered or unexported fields
}
ChatRoom chatRoomCtx -> ChatRoom => 维系每个人的上下文
type GptModel ¶ added in v1.2.10
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 ¶ added in v1.6.3
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 ¶ added in v1.5.4
SystemRoles 表名:roles,存放系统角色
Click to show internal directories.
Click to hide internal directories.