Prerequisites
🚀 Feature Proposal
Be able to call reply.sse in any route, not only in sse: true routes, dynamically depending on the route logic. (And properly closing the SSE stream on ending the request, and/or exceptions)
Motivation
OpenAI and LLMs use SSE in a novel way in that they simply return an SSE response when you request streaming. They don't send an Accept header, but rather decide based on the body whether to stream or not, so the handler might send a normal response or it might send an SSE response depending on the request.
Example
No response
Prerequisites
🚀 Feature Proposal
Be able to call
reply.ssein any route, not only insse: trueroutes, dynamically depending on the route logic. (And properly closing the SSE stream on ending the request, and/or exceptions)Motivation
OpenAI and LLMs use SSE in a novel way in that they simply return an SSE response when you request streaming. They don't send an
Acceptheader, but rather decide based on thebodywhether to stream or not, so the handler might send a normal response or it might send an SSE response depending on the request.Example
No response