diff options
| author | Dhravya <[email protected]> | 2024-04-01 00:00:17 -0700 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-04-01 00:00:17 -0700 |
| commit | a00bb3063dbd3fee191c115353698ae5dedc83fa (patch) | |
| tree | 3f30d66cbe1d953e0408ea3f8323948ac57695a4 | |
| parent | fix: donechunk fix (diff) | |
| download | supermemory-a00bb3063dbd3fee191c115353698ae5dedc83fa.tar.xz supermemory-a00bb3063dbd3fee191c115353698ae5dedc83fa.zip | |
gracefully end stream
| -rw-r--r-- | apps/cf-ai-backend/src/index.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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(); } |