Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Fix chatStream from crashing when incomplete lines are streamed from Axios #14

Conversation

mikeyjkmo
Copy link

chatStream currently breaks as the chunks being yielded from Axios are not guaranteed to be complete lines. This leads to a crash on yield JSON.parse(chunkData) (line 184 of the original code) as parsing fails.

This lineGenerator should live in a separate file and have its own unit tests, but I don't see any tests nor other files in this repository. Opening this for discussion.

@flore2003
Copy link
Contributor

This seems to fix #18, correct?

@mikeyjkmo
Copy link
Author

Yes I believe so

@Bam4d Bam4d mentioned this pull request Dec 19, 2023
@Bam4d Bam4d closed this Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants