feat: 增加 ChatGPTUnofficialProxyAPI 的模型自定义配置 (#632)
* feat: 增加 ChatGPTUnofficialProxyAPI 的模型自定义配置(#618) * perf: 修改判断 --------- Co-authored-by: ChenZhaoYu <790348264@qq.com>
This commit is contained in:
parent
e30217542d
commit
9c6a3d6110
|
@ -67,10 +67,13 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI
|
||||||
apiModel = 'ChatGPTAPI'
|
apiModel = 'ChatGPTAPI'
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
const OPENAI_API_MODEL = process.env.OPENAI_API_MODEL
|
||||||
const options: ChatGPTUnofficialProxyAPIOptions = {
|
const options: ChatGPTUnofficialProxyAPIOptions = {
|
||||||
accessToken: process.env.OPENAI_ACCESS_TOKEN,
|
accessToken: process.env.OPENAI_ACCESS_TOKEN,
|
||||||
debug: true,
|
debug: true,
|
||||||
}
|
}
|
||||||
|
if (isNotEmptyString(OPENAI_API_MODEL))
|
||||||
|
options.model = OPENAI_API_MODEL
|
||||||
|
|
||||||
if (isNotEmptyString(process.env.API_REVERSE_PROXY))
|
if (isNotEmptyString(process.env.API_REVERSE_PROXY))
|
||||||
options.apiReverseProxyUrl = process.env.API_REVERSE_PROXY
|
options.apiReverseProxyUrl = process.env.API_REVERSE_PROXY
|
||||||
|
|
Loading…
Reference in New Issue