소스 검색

fixup: decode in stream mode

Yidadaa 1 년 전
부모
커밋
9e602eb575
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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) {