From 41ba8a2a08b95c5029203e2fcefa0468e8039b85 Mon Sep 17 00:00:00 2001 From: lyf <1910527151@qq.com> Date: Tue, 6 Aug 2024 20:34:16 +0800 Subject: [PATCH] =?UTF-8?q?gpt4=E7=A6=81=E6=AD=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/openai.ts | 2 +- app/config/server.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/api/openai.ts b/app/api/openai.ts index 6d11d679215..d32e45dd997 100644 --- a/app/api/openai.ts +++ b/app/api/openai.ts @@ -13,7 +13,7 @@ function getModels(remoteModelRes: OpenAIListModelResponse) { if (config.disableGPT4) { remoteModelRes.data = remoteModelRes.data.filter( - (m) => !m.id.startsWith("gpt-4"), + (m) => !m.id.startsWith("gpt-4") || m.id.startsWith("gpt-40-mini"), ); } diff --git a/app/config/server.ts b/app/config/server.ts index 70c20ce644f..3ac634fabde 100644 --- a/app/config/server.ts +++ b/app/config/server.ts @@ -114,10 +114,16 @@ export const getServerSideConfig = () => { if (disableGPT4) { if (customModels) customModels += ","; - customModels += DEFAULT_MODELS.filter((m) => m.name.startsWith("gpt-4")) + customModels += DEFAULT_MODELS.filter( + (m) => m.name.startsWith("gpt-4") && !m.name.startsWith("gpt-4o-mini"), + ) .map((m) => "-" + m.name) .join(","); - if (defaultModel.startsWith("gpt-4")) defaultModel = ""; + if ( + defaultModel.startsWith("gpt-4") && + !defaultModel.startsWith("gpt-4o-mini") + ) + defaultModel = ""; } const isStability = !!process.env.STABILITY_API_KEY;