Skip to main content

sse_single_response

Function sse_single_response 

Source
pub fn sse_single_response(
    message: ResponseMessage,
    finish_reason: &str,
    model: &str,
) -> Response
Expand description

Emit a complete non-streaming response as an SSE event sequence

Used when the caller requested stream: true but the backend performed a non-streaming complete() (e.g. for tool-calling downgrade). Produces:

  1. Role announcement chunk with content and/or tool_calls
  2. Final chunk with finish_reason
  3. [DONE] sentinel