5 ms·
Curious why is this trending? Btw sse are pretty great, only thing I don't get is why they don't allow for binary payloads. That'd have been the icing on the ca
by 0xCAP 3y ago
Curious why is this trending? Btw sse are pretty great, only thing I don't get is why they don't allow for binary payloads. That'd have been the icing on the cake.
- asplake 3y agoProbably as a result of https://news.ycombinator.com/item?id=35937554 https://news.ycombinator.com/item?id=35937554
- marpstar 3y agoMy first thought was ChatGPT API's `stream` option: https://platform.openai.com/docs/api-reference/completions/create#completions/create-stream https://platform.openai.com/docs/api-reference/completions/c...
- corentin88 3y agoOP here. I was looking at Anthropic's website as a result of https://news.ycombinator.com/item?id=35948742 https://news.ycombinator.com/item?id=35948742 Turns out in their FAQ, they have this: > Our API is designed to be a backend that incorporates Claude into any application you’ve developed. Our application sends text to our API, then receives a response via *server-sent events*, a streaming protocol for the web. We have API documentation with drop-in example code in Python and Typescript to get you started. Was curious what it was and thought it was probably worth sharing. Didn't knew OpenAI uses the same mechanism.
- VWWHFSfQ 3y ago> only thing I don't get is why they don't allow for binary payloads I've always appreciated that it's just a simple line-oriented UTF-8 text protocol. Binary transfers are handled more efficiently with something else. Or just base64 the payload if it's not that big of a deal.
- mikek 3y agoOpenAI uses this in their APIs to stream tokens
- b33j0r 3y agoThis got into the zeitgeist somehow. I just implemented my first SSE app with FastAPI last week, then I saw a youtube video and this post! I was implementing something with websockets and asked chatgpt to tell me about modern alternatives. In my years of full-stack… I hadn’t heard of SSE, or at least never got why I should care. Damn, I see the limitations of REST, but I was building state machines and custom protocols with websockets. It’s nice to prototype in REST again. REST+SSE ftw, I guess!
- bullen 3y agoString parsing is never the bottleneck. You need to parallelize (shared memory) and understand your system and for that text is pretty convenient. So also avoid HTTPS. It's trending because it's the final real-time solution for eternity.