From 69fcb92a3b1c9417ebe8be88ebc88a8dd9192446 Mon Sep 17 00:00:00 2001 From: "Q.A.zh" <40236765+QAbot-zh@users.noreply.github.com> Date: Mon, 30 Dec 2024 02:54:15 +0000 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E7=A9=BA=E6=A0=BC=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0custom=5Fmodels=20=E5=AE=B9=E9=94=99=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/model.ts | 1 + test/model.test.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/utils/model.ts b/app/utils/model.ts index a8ce93f4d..c20e59594 100644 --- a/app/utils/model.ts +++ b/app/utils/model.ts @@ -76,6 +76,7 @@ export function collectModelTable( // server custom models customModels .split(",") + .map((v) => v.trim()) .filter((v) => !!v && v.length > 0) .forEach((m) => { const available = !m.startsWith("-"); diff --git a/test/model.test.ts b/test/model.test.ts index e9bc986f3..74f4639c4 100644 --- a/test/model.test.ts +++ b/test/model.test.ts @@ -127,7 +127,7 @@ describe('collectModelTable', () => { }); test('All models except OpenAI should be excluded, and additional models should be added when customized as "-all, +*openai,gpt-4o@azure"', () => { - const customModels = '-all, +*openai,gpt-4o@azure'; + const customModels = '-all,+*openai,gpt-4o@azure'; const result = collectModelTable(mockModels, customModels); expect(result['gpt-3.5-turbo@openai'].available).toBe(true);