Skip to main content

Module executor

Module executor 

Source
Expand description

Standard-lane executor: walk a route’s legs with per-leg breaker + retry.

Structs§

CommittedStream
A committed streaming leg: the winning provider/model plus the remaining item stream (first item already re-prepended).
Completion
Normalised result of one completed LLM call.
StreamTimeouts
Time bounds for a streaming leg.

Enums§

LegError
Errors from a single streaming leg. Start failures are fallback-eligible.

Functions§

execute_buffered
Buffered (non-streaming) executor: walk legs, fully buffering each. Any failure (start or mid-stream) advances to the next leg. Nothing is ever flushed to the client, so full-chain fallback is preserved.
execute_buffered_with_timeouts
Buffered executor with explicit first-chunk and idle timeouts. Walk legs, fully buffering each. Any failure (start, timeout, or mid-stream) advances to the next leg. Nothing is ever flushed to the client, so full-chain fallback is preserved.
execute_chain
Walk legs in order. Retryable failure (or open breaker) advances; the first non-retryable failure aborts. Returns AllLegsFailed if every leg fails.
execute_streaming
Streaming executor: for each leg, start the stream and peek the first item. First leg to yield an item is committed; failures before the first item fall back. After commitment there is no fallback (caller surfaces mid-stream errors as SSE error events).
execute_streaming_with_timeouts
Streaming executor with explicit first-chunk timeout. For each leg, start the stream and peek the first item within t.first_chunk. First leg to yield an item is committed; failures (including timeout) before the first item fall back. After commitment there is no fallback.
stream_one_leg_standard
Standard-lane per-leg primitive: open a genai stream, normalize to StreamItem. Outer Err(LegError::Start) = stream could not begin (fallback-eligible).