Skip to main content

Module streaming

Module streaming 

Source
Expand description

SSE (Server-Sent Events) streaming for OpenAI-compatible chat completions.

Structs§

ChatStream
A streaming chat completion response.
StreamChoice
StreamChunk
A single chunk in the SSE stream.
StreamDelta
StreamUsage

Functions§

finish_chunk
The terminal chunk carrying the real finish_reason.
token_chunk
tool_calls_chunk
A content-delta chunk (built synchronously from the generation thread). One delta carrying the aggregated tool calls, indexed for clients that merge by index.
usage_chunk
The usage chunk (empty choices, real counts) sent just before the finish chunk, exactly as OpenAI’s stream_options.include_usage does.