Skip to main content

Module streaming

Module streaming 

Source
Expand description

SSE streaming support for LLM provider responses.

Provides types and parsing for Server-Sent Events (SSE) used by streaming LLM APIs (OpenAI Responses API, Anthropic, etc.).

Structs§

FnStreamCallback
A closure-based StreamCallback.

Enums§

StreamEvent
Events emitted during a streaming LLM response.

Traits§

StreamCallback
Callback for stream events. Implementations should be cheap/non-blocking.

Functions§

parse_sse_block
Parse an SSE event block (event type + data) from raw lines.
parse_sse_data
Parse a single SSE data line (after “data: “ prefix) as JSON.