We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a0bbbe commit 240b279Copy full SHA for 240b279
tools/server/webui/src/lib/services/chat.ts
@@ -264,12 +264,14 @@ export class ChatService {
264
let lastTimings: ChatMessageTimings | undefined;
265
266
try {
267
+ let chunk = '';
268
while (true) {
269
const { done, value } = await reader.read();
270
if (done) break;
271
- const chunk = decoder.decode(value, { stream: true });
272
+ chunk += decoder.decode(value, { stream: true });
273
const lines = chunk.split('\n');
274
+ chunk = lines.pop() || ''; // Save incomplete line for next read
275
276
for (const line of lines) {
277
if (line.startsWith('data: ')) {
0 commit comments