Skip to main content

Module stream

Module stream 

Source
Expand description

LLM transport extension point.

StreamFn is the swappable boundary between the loop and any provider: real LLM API call (production), recorded-fixture replay (eval), scripted scenario (tests), remote proxy (gateway). One trait method, typed request/response.

The loop never imports a specific provider; the caller assembles a LoopConfig with a StreamFn implementation of their choice.

Structs§

StreamRequest
Inputs for one LLM call.
StreamResponse
Final assembled response from one LLM call. Producers that don’t need fine-grained streaming can return a BoxStream that yields just one Done event.
ToolSchema
Tool schema as the provider sees it.

Enums§

AssistantStreamChunk
One token-level chunk during streaming.
ReasoningEffort
Reasoning-effort levels accepted by every supported provider.
StreamErrorKind
Coarse classification of a stream error.
StreamEvent
Streamed event from the provider.

Traits§

StreamFn
The transport trait. One method, typed in/out.