From 9c6a3d6110f5aaba888dc7140c166a120f956e61 Mon Sep 17 00:00:00 2001 From: hncboy <619452863@qq.com> Date: Wed, 22 Mar 2023 19:00:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20ChatGPTUnofficialP?= =?UTF-8?q?roxyAPI=20=E7=9A=84=E6=A8=A1=E5=9E=8B=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=85=8D=E7=BD=AE=20(#632)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 增加 ChatGPTUnofficialProxyAPI 的模型自定义配置(#618) * perf: 修改判断 --------- Co-authored-by: ChenZhaoYu <790348264@qq.com> --- service/src/chatgpt/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/src/chatgpt/index.ts b/service/src/chatgpt/index.ts index fc25bd2..62e4b03 100644 --- a/service/src/chatgpt/index.ts +++ b/service/src/chatgpt/index.ts @@ -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