Skip to content

Commit

Permalink
feat: 增加 ChatGPTUnofficialProxyAPI 的模型自定义配置 (Chanzhaoyu#632)
Browse files Browse the repository at this point in the history
* feat: 增加 ChatGPTUnofficialProxyAPI 的模型自定义配置(Chanzhaoyu#618)

* perf: 修改判断

---------

Co-authored-by: ChenZhaoYu <[email protected]>
  • Loading branch information
hncboy and Chanzhaoyu committed Mar 22, 2023
1 parent e302175 commit 9c6a3d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions service/src/chatgpt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c6a3d6

Please sign in to comment.