finish baidu ai model api implementation

This commit is contained in:
RockYang
2023-10-11 14:21:16 +08:00
parent 4fc01f3f7b
commit ba206bb387
9 changed files with 171 additions and 62 deletions

View File

@@ -67,4 +67,8 @@ var ModelToTokens = map[string]int{
"gpt-3.5-turbo-16k": 16384,
"gpt-4": 8192,
"gpt-4-32k": 32768,
"chatglm_pro": 32768,
"chatglm_std": 16384,
"chatglm_lite": 4096,
"ernie_bot_turbo": 8192, // 文心一言
}

View File

@@ -79,6 +79,7 @@ type ChatConfig struct {
OpenAI ModelAPIConfig `json:"open_ai"`
Azure ModelAPIConfig `json:"azure"`
ChatGML ModelAPIConfig `json:"chat_gml"`
Baidu ModelAPIConfig `json:"baidu"`
EnableContext bool `json:"enable_context"` // 是否开启聊天上下文
EnableHistory bool `json:"enable_history"` // 是否允许保存聊天记录