This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Issue with Perplexity Streamed Responses: Non-Standard ServerSideEvents Separator #191
Closed
timlenardo
started this conversation in
General
Replies: 1 comment
-
Thank you very much for sharing and for being a Perplexity user! Looking forward to seeing what you build. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posting for posterity (or maybe even a fix from the Perplexity team?) -
In our project, we've implemented and tested streamed responses from multiple model providers - GoogleAI, OpenAI, Anthropic, Deepseek, xAI, and also model hosting sites like OpenRouter and Groq. Our implementation is based on EventSource, which works seamlessly.
It didn't work for Perplexity. After investigation, we found that the Perplexity streaming endpoints use a non-standard event separator. The Perplexity API delineates events with "\r\n\r\n", instead of "\n\n" like other model providers (and the SSE guidelines).
We were able to get it working by implementing a custom parser.
Posting here in case it's helpful to anyone else!
Beta Was this translation helpful? Give feedback.
All reactions