-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistency? #48
Comments
I just saw this: 6cda129 Does the current implementation solve all of the incomplete data cases I mention in the OP, or just when one new line is missing? What about when both new lines are missing? |
@taylorgoolsby The current implementation handles both cases correctly. If there is only one newline or no newline at the end of the stream, react-native-sse does not dispatch the last event yet. It waits until there is a double newline. |
Hi,
This is not an issue, but I am wondering about consistency and safety in using this package for LLM inference.
In Node, I have used axios to stream the responses from an LLM. However, in that implementation, which does not use XHR, I noticed that sometimes it is possible to receive data packets which are incomplete.
For example, I have seen these cases happen:
The expected case:
Incomplete data:
Missing both new lines:
Missing one new line:
To handle these cases, my implementation in axios ended up looking like this:
I have been using this implementation for a while, and I am fairly certain this is able to handle all possible incomplete data packet cases.
But looking at the implementation of this package, I saw that it does not make use of any buffering in case
this._handleEvent(xhr.responseText || '');
has incomplete data.Is this not a concern with XHR? Maybe axios or node processes incoming data packets differently (faster event loop), causing events with partial data? I am wondering what would happen if maybe when using this package on a mobile device, with slow internet connection, if data packets could be emitted with incomplete payloads.
The text was updated successfully, but these errors were encountered: