Expand description
Streaming text generation (stream_text).
The step loop runs in a background task and emits StreamEvents
through a bounded channel; the consumer side applies the user transforms,
accumulates step results and resolves the Completion.
Design: docs/01-architecture/07-generation-loop-and-streaming.md §3.
Re-exports§
pub use transforms::StreamTransform;pub use transforms::TransformContext;pub use transforms::smooth_stream;
Modules§
- transforms
- Transforms applied to the event stream before step results are accumulated.
Structs§
- Completion
- Drives the event pipeline and resolves with its final result.
- Stream
Error Info - Serializable projection of an
Errorcarried in a stream. - Stream
Text - Builder and future of a
stream_textcall. - Stream
Text Result - Result of a streaming call with independent event views and a final result.
Enums§
- Error
Decision - What the pipeline does after an error reported by the model stream.
- Stream
Event - One event of a text stream. Serializable, so applications can forward events over SSE or WebSocket frames unchanged.
Traits§
- OnError
Fn - Callback invoked for every error that occurs while streaming.
Functions§
- stream_
text - Starts building a streaming text generation call.
Type Aliases§
- Event
Stream - A boxed stream of
StreamEvents.