Streaming result wrapper exposing semantic and raw event streams plus cancellation controls.
Summary
Functions
Cancels the streaming run.
Returns a stream of semantic events. Automatically starts the underlying streaming process on first invocation.
Pops the next semantic event from the queue, blocking up to timeout.
Returns a stream of the raw Codex events.
Returns the aggregated usage captured so far.
Types
Functions
@spec cancel(t(), :immediate | :after_turn) :: :ok
Cancels the streaming run.
Modes:
:immediate- stop immediately:after_turn- finish the current turn then halt
@spec events(t()) :: Enumerable.t()
Returns a stream of semantic events. Automatically starts the underlying streaming process on first invocation.
Pops the next semantic event from the queue, blocking up to timeout.
Returns {:error, reason} if the stream terminates with an error.
@spec raw_events(t()) :: Enumerable.t()
Returns a stream of the raw Codex events.
Returns the aggregated usage captured so far.