Skip to content

Commit

Permalink
fix: Add check for "[DONE]" message in QianWenBot
Browse files Browse the repository at this point in the history
  • Loading branch information
sunner committed Mar 17, 2024
1 parent fc19733 commit 996a900
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bots/QianWenBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export default class QianWenBot extends Bot {
});

source.addEventListener("message", (event) => {
if (event.data === "[DONE]") return;

if (event.data === "") {
// Empty message usually means error
const resp = JSON.parse(source.chunk);
Expand Down

0 comments on commit 996a900

Please sign in to comment.