From 789f3d993c227209de1419a2f7d8349100223e93 Mon Sep 17 00:00:00 2001 From: "kirk.shan" Date: Thu, 18 May 2023 10:25:06 +0800 Subject: [PATCH] fix content-type = text/event-stream;charset=utf-8 --- app/client/platforms/openai.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 2a28debd3..d833e8c5d 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -99,7 +99,9 @@ export class ChatGPTApi implements LLMApi { if ( !res.ok || - res.headers.get("content-type") !== EventStreamContentType || + !res.headers + .get("content-type") + ?.startsWith(EventStreamContentType) || res.status !== 200 ) { const responseTexts = [responseText];