Skip to content

Commit

Permalink
fix: apply fix manually
Browse files Browse the repository at this point in the history
  • Loading branch information
louisjoecodes committed Dec 14, 2024
1 parent bef6659 commit 020d96c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/core/streaming-fetcher/Stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,14 @@ export class Stream<T> implements AsyncIterable<T> {
return;
}

// Otherwise, yield message from the prefix to the terminator
const message = await this.parse(JSON.parse(line));
yield message;
// (Louis custom fix do not override) Trim whitespace and check if line is not empty
// Reason: ElevenLabs occasionally returns empty chunks
const trimmedLine = line.trim();
if (trimmedLine) {
const message = await this.parse(JSON.parse(trimmedLine));
yield message;
}

prefixSeen = false;
}
}
Expand Down

0 comments on commit 020d96c

Please sign in to comment.