Skip to content

Support for dynamic SSE without Accept header #16

@segevfiner

Description

@segevfiner

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions