From 4a450b884837f1cb05e27408548e70c0f37938e4 Mon Sep 17 00:00:00 2001 From: Vinlic Date: Mon, 29 Apr 2024 09:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=A6=96=E8=BD=AE=E4=BC=A0no?= =?UTF-8?q?ne=E5=AF=B9=E8=AF=9DID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/controllers/chat.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/api/controllers/chat.ts b/src/api/controllers/chat.ts index a779cc0..c95ef09 100644 --- a/src/api/controllers/chat.ts +++ b/src/api/controllers/chat.ts @@ -184,6 +184,10 @@ async function createCompletion( ) : []; + // 如果引用对话ID不正确则重置引用 + if (!/[0-9a-zA-Z]{24}/.test(refConvId)) + refConvId = ''; + // 请求流 const token = await acquireToken(refreshToken); const result = await axios.post( @@ -282,6 +286,10 @@ async function createCompletionStream( ) : []; + // 如果引用对话ID不正确则重置引用 + if (!/[0-9a-zA-Z]{24}/.test(refConvId)) + refConvId = ''; + // 请求流 const token = await acquireToken(refreshToken); const result = await axios.post(