fix: fixed bug for chat request's token reach the max token limit for OpenAI

This commit is contained in:
RockYang
2023-08-01 17:58:03 +08:00
parent 9eb8da2789
commit fdd659f393
3 changed files with 30 additions and 12 deletions

View File

@@ -53,3 +53,10 @@ type ApiError struct {
const PromptMsg = "prompt" // prompt message
const ReplyMsg = "reply" // reply message
var ModelToTokens = map[string]int{
"gpt-3.5-turbo": 4096,
"gpt-3.5-turbo-16k": 16384,
"gpt-4": 8192,
"gpt-4-32k": 32768,
}