Expand description
LLM token streaming.
Providers that support real streaming override CloudAiProvider::invoke_stream
to push deltas through a LlmStreamSink as they arrive; providers without
streaming support inherit the default impl, which calls invoke and emits a
single final delta + done = true. That keeps the call signature uniform so
the executor + agentic path can opt into streaming without per-provider
branching, and the frontend chip ticks something useful in both cases.
Structs§
- Capturing
Stream Sink - Buffering sink used by tests. Captures every event so assertions can inspect deltas, done-flags, and errors after the fact.
- LlmStream
Event - A single chunk of generated text emitted as the model produces tokens.
- Null
Stream Sink - No-op sink. Useful in headless tests + as the default
Executorfield value soExecutor::rundoesn’t require a real sink when nobody cares about streaming.
Traits§
- LlmStream
Sink - Async fan-out target for
LlmStreamEvents. Providers receive a&dyn LlmStreamSink, callemitonce per chunk, and the caller decides what happens with the events (Tauri broadcasts to the frontend; tests collect into a Vec).