fix: streaming doesn't work when newline characters are malformed

This commit is contained in:
Dhravya 2024-03-31 23:48:04 -07:00
parent a919affca3
commit f87534d4a7

View file

@ -167,7 +167,7 @@ export default {
const encodedChunk = converter.encode("data: " + JSON.stringify({ "response": chunkText }) + "\n\n");
controller.enqueue(encodedChunk);
}
const doneChunk = converter.encode("data: [DONE] \n\n");
const doneChunk = converter.encode("data: [DONE]");
controller.enqueue(doneChunk);
controller.close();
}