Skip to main content

run_loop_stream

Function run_loop_stream 

Source
pub fn run_loop_stream(
    agent: Arc<dyn Agent>,
    tools: HashMap<String, Arc<dyn Tool>>,
    run_ctx: RunContext,
    cancellation_token: Option<RunCancellationToken>,
    state_committer: Option<Arc<dyn StateCommitter>>,
    decision_rx: Option<UnboundedReceiver<ToolCallDecision>>,
) -> Pin<Box<dyn Stream<Item = AgentEvent> + Send>>
Expand description

Run the agent loop with streaming output.

Returns a stream of AgentEvent for real-time updates. Tools are passed directly and used as the default tool set unless the agent’s step_tool_provider is set (for dynamic per-step tool resolution).