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(