Skip to content

Commit 9c6a3d6

Browse files
hncboyChanzhaoyu
andauthored
feat: 增加 ChatGPTUnofficialProxyAPI 的模型自定义配置 (#632)
* feat: 增加 ChatGPTUnofficialProxyAPI 的模型自定义配置(#618) * perf: 修改判断 --------- Co-authored-by: ChenZhaoYu <790348264@qq.com>
1 parent e302175 commit 9c6a3d6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

service/src/chatgpt/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ let api: ChatGPTAPI | ChatGPTUnofficialProxyAPI
6767
apiModel = 'ChatGPTAPI'
6868
}
6969
else {
70+
const OPENAI_API_MODEL = process.env.OPENAI_API_MODEL
7071
const options: ChatGPTUnofficialProxyAPIOptions = {
7172
accessToken: process.env.OPENAI_ACCESS_TOKEN,
7273
debug: true,
7374
}
75+
if (isNotEmptyString(OPENAI_API_MODEL))
76+
options.model = OPENAI_API_MODEL
7477

7578
if (isNotEmptyString(process.env.API_REVERSE_PROXY))
7679
options.apiReverseProxyUrl = process.env.API_REVERSE_PROXY

0 commit comments

Comments
 (0)