Skip to content
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

Ignore lines that start with : ping #472

Merged
merged 5 commits into from
Feb 1, 2024
Merged

Ignore lines that start with : ping #472

merged 5 commits into from
Feb 1, 2024

Conversation

gavi
Copy link
Contributor

@gavi gavi commented Jan 9, 2024

When testing the client with streaming chat, I noticed the JSON parser crashes for lines that start at with ": ping", I believe its because the api sends chunks with event: ping which needs to be ignored

@kayhantolga
Copy link
Member

I I didn't notice such a thing before. Do you think this is new behavior? Do you have any sample code or prompt?

@gavi
Copy link
Contributor Author

gavi commented Jan 24, 2024

I was using the client with text-generation-webui openai plugin and noticed the crash. Then I checked the official python implementation from openai and saw the ping messages in their src/test_streaming.py
Edit:

Just to add the spec: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation

@kayhantolga kayhantolga added this to the 7.4.5 milestone Jan 30, 2024
@kayhantolga
Copy link
Member

I have made some updates. I thought that maybe someone might find this data useful, so I kept it as optional.

Could you test my implementation to see if it helps? I couldn't test it because I don't have any prompts to trigger pings. I would greatly appreciate it if you could share one with me.

@kayhantolga kayhantolga added the Ready for next version This issue solved and waiting for next release label Jan 31, 2024
@kayhantolga kayhantolga merged commit 7efeaf0 into betalgo:dev Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for next version This issue solved and waiting for next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants