Skip to content

Commit

Permalink
Merge pull request #6 from MarchPhantasia/bugFix
Browse files Browse the repository at this point in the history
fix: error caused by '[DONE]' flag in response
  • Loading branch information
mumu-lhl authored Nov 15, 2024
2 parents 456598a + 742a190 commit e9445e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Chat {
let text = "";
const stream = events(message);
for await (const event of stream) {
if (event.data) {
if (event.data && event.data != "[DONE]") {
const messageData = JSON.parse(event.data);
if (messageData["message"] == undefined) {
break;
Expand Down

0 comments on commit e9445e1

Please sign in to comment.