feat: 增加 ChatGPTUnofficialProxyAPI 的模型自定义配置 (#632)

* feat: 增加 ChatGPTUnofficialProxyAPI 的模型自定义配置(#618)

* perf: 修改判断

---------

Co-authored-by: ChenZhaoYu <790348264@qq.com>
This commit is contained in:
hncboy 2023-03-22 19:00:58 +08:00 committed by GitHub
parent e30217542d
commit 9c6a3d6110
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -67,10 +67,13 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI
apiModel = 'ChatGPTAPI'
}
else {
const OPENAI_API_MODEL = process.env.OPENAI_API_MODEL
const options: ChatGPTUnofficialProxyAPIOptions = {
accessToken: process.env.OPENAI_ACCESS_TOKEN,
debug: true,
}
if (isNotEmptyString(OPENAI_API_MODEL))
options.model = OPENAI_API_MODEL
if (isNotEmptyString(process.env.API_REVERSE_PROXY))
options.apiReverseProxyUrl = process.env.API_REVERSE_PROXY