diff --git a/apps/cf-ai-backend/src/index.ts b/apps/cf-ai-backend/src/index.ts index 429d5f9b..f4843601 100644 --- a/apps/cf-ai-backend/src/index.ts +++ b/apps/cf-ai-backend/src/index.ts @@ -136,7 +136,7 @@ export default { const encodedChunk = converter.encode("data: " + JSON.stringify({ "response": chunkText }) + "\n\n"); controller.enqueue(encodedChunk); } - const doneChunk = converter.encode("[DONE]"); + const doneChunk = converter.encode("data: [DONE]"); controller.enqueue(doneChunk); controller.close(); } @@ -167,7 +167,7 @@ export default { const encodedChunk = converter.encode("data: " + JSON.stringify({ "response": chunkText }) + "\n\n"); controller.enqueue(encodedChunk); } - const doneChunk = converter.encode("[DONE]"); + const doneChunk = converter.encode("data: [DONE]"); controller.enqueue(doneChunk); controller.close(); }