feat: 支持上下文深度配置,计算每轮对话消耗的总 token 数量

This commit is contained in:
RockYang
2023-07-15 18:37:25 +08:00
parent 9126cfff20
commit 3e41edd3b5
3 changed files with 50 additions and 13 deletions

View File

@@ -72,7 +72,9 @@ type ChatConfig struct {
MaxTokens int `json:"max_tokens"`
EnableContext bool `json:"enable_context"` // 是否开启聊天上下文
EnableHistory bool `json:"enable_history"` // 是否允许保存聊天记录
ApiKey string `json:"api_key"` // OpenAI API key
ApiKey string `json:"api_key"`
ContextDeep int `json:"context_deep"` // 上下文深度
}
type SystemConfig struct {