Skip to main content

Module stream_events

Module stream_events 

Source
Expand description

Single-turn streaming with terminal completion evidence.

crate::llm::LlmBroker::generate_stream_events yields StreamEvents for one model turn. Every stream ends with exactly one terminal event: StreamEvent::Completed when the provider reported a clean stop, or StreamEvent::Error otherwise. Nothing follows the terminal event.

Content yielded before an error is evidence of what the provider sent, not a result. Truncated or unfinished output is always an error.

Enums§

StreamEvent
One event in a single-turn event stream.
StreamEventError
Why a single-turn event stream ended without a completed response.

Type Aliases§

StreamEventStream
A boxed stream of StreamEvents for one model turn.