From d13ba31d0e3e4d41ee5949a59a9e5e4b6940bccb Mon Sep 17 00:00:00 2001 From: Vinlic Date: Sat, 9 Mar 2024 15:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/controllers/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/controllers/chat.ts b/src/api/controllers/chat.ts index 0e9e7c0..53ba25d 100644 --- a/src/api/controllers/chat.ts +++ b/src/api/controllers/chat.ts @@ -161,7 +161,7 @@ async function receiveStream(convId: string, stream: any) { data.choices[0].message.content += result.text; } else if (result.event == 'all_done' || result.event == 'error') { - data.choices[0].message.content += '\n[内容由于不合规被停止生成,我们换个话题吧]' + (refContent ? `\n\n搜索结果来自:\n${refContent}` : ''); + data.choices[0].message.content += (result.event == 'error' ? '\n[内容由于不合规被停止生成,我们换个话题吧]' : '') + (refContent ? `\n\n搜索结果来自:\n${refContent}` : ''); refContent = ''; resolve(data); }