From 2ce738b1fc6995632ee4ee11ab42233a0ee8a826 Mon Sep 17 00:00:00 2001 From: Vinlic Date: Tue, 31 Dec 2024 12:47:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9D=9E=E9=A2=84=E6=9C=9F?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=90=8D=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/controllers/chat.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/controllers/chat.ts b/src/api/controllers/chat.ts index 7a3dc81..ebec285 100644 --- a/src/api/controllers/chat.ts +++ b/src/api/controllers/chat.ts @@ -191,7 +191,7 @@ async function createCompletion( // 如果引用对话ID不正确则重置引用 if (!/[0-9a-zA-Z]{24}/.test(refConvId)) refConvId = ""; - let assistantId = /^[a-z0-9]{24,}$/.test(model) ? model : undefined; + let assistantId = /^[a-z0-9]{24,}$/.test(model) ? model : DEFAULT_ASSISTANT_ID; if(model.indexOf('think') != -1 || model.indexOf('zero') != -1) { assistantId = ZERO_ASSISTANT_ID; @@ -302,7 +302,7 @@ async function createCompletionStream( // 如果引用对话ID不正确则重置引用 if (!/[0-9a-zA-Z]{24}/.test(refConvId)) refConvId = ""; - let assistantId = /^[a-z0-9]{24,}$/.test(model) ? model : undefined; + let assistantId = /^[a-z0-9]{24,}$/.test(model) ? model : DEFAULT_ASSISTANT_ID; if(model.indexOf('think') != -1 || model.indexOf('zero') != -1) { assistantId = ZERO_ASSISTANT_ID;