feat: 当用gpt-4的API 时增加可用的 Max Tokens (#729)
* fix: 用GPT-4 API时增加max token * style: eslint fix --------- Co-authored-by: Redon <790348264@qq.com>
This commit is contained in:
parent
bf48eae9fe
commit
3e509f6663
|
@ -45,6 +45,19 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI
|
|||
debug: true,
|
||||
}
|
||||
|
||||
// increase max token limit if use gpt-4
|
||||
if (model.toLowerCase().includes('gpt-4')) {
|
||||
// if use 32k model
|
||||
if (model.toLowerCase().includes('32k')) {
|
||||
options.maxModelTokens = 32768
|
||||
options.maxResponseTokens = 8192
|
||||
}
|
||||
else {
|
||||
options.maxModelTokens = 8192
|
||||
options.maxResponseTokens = 2048
|
||||
}
|
||||
}
|
||||
|
||||
if (isNotEmptyString(OPENAI_API_BASE_URL))
|
||||
options.apiBaseUrl = `${OPENAI_API_BASE_URL}/v1`
|
||||
|
||||
|
|
Loading…
Reference in New Issue