From 1648f3bdc8c226634f6ea27818d9565710dff709 Mon Sep 17 00:00:00 2001 From: Vinlic Date: Tue, 10 Dec 2024 18:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=81=E4=BC=A0=E8=BE=93?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=9A=84=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/controllers/chat.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/controllers/chat.ts b/src/api/controllers/chat.ts index ad8eede..73cea02 100644 --- a/src/api/controllers/chat.ts +++ b/src/api/controllers/chat.ts @@ -767,7 +767,10 @@ function createTransStream(model: string, stream: any, refConvId: string, endCal ); stream.once( "close", - () => !transStream.closed && transStream.end("data: [DONE]\n\n") + () => { + !transStream.closed && transStream.end("data: [DONE]\n\n"); + endCallback && endCallback(); + } ); return transStream; }