Browse Source

fixup: decode in stream mode

Yidadaa 1 year ago
parent
commit
9e602eb575
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/client/platforms/openai.ts

+ 1 - 1
app/client/platforms/openai.ts

@@ -94,7 +94,7 @@ export class ChatGPTApi implements LLMApi {
             return finish();
           }
 
-          const chunk = decoder.decode(value);
+          const chunk = decoder.decode(value, { stream: true });
           const lines = chunk.split("data: ");
 
           for (const line of lines) {