Pārlūkot izejas kodu

Merge pull request #1592 from sjnho/main

fix #1590 Render the whole stream response body
Yifei Zhang 2 gadi atpakaļ
vecāks
revīzija
42711d76d6
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      app/client/platforms/openai.ts

+ 3 - 1
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];