Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

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

Merged
merged 3 commits into from
Mar 22, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions service/src/chatgpt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,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 (OPENAI_API_MODEL && typeof OPENAI_API_MODEL === 'string')
options.model = OPENAI_API_MODEL

if (isNotEmptyString(process.env.API_REVERSE_PROXY))
options.apiReverseProxyUrl = process.env.API_REVERSE_PROXY
Expand Down