Skip to main content

run_loop_stream

Function run_loop_stream 

Source
pub async fn run_loop_stream<A, F>(
    agent: &A,
    session: &mut Session<A::Msg>,
    config: &LoopConfig,
    on_event: F,
) -> Result<usize, A::Error>
where A: SgrAgentStream, F: FnMut(LoopEvent<'_, A::Action>) + Send,
Expand description

Run the SGR agent loop with streaming tokens.

Same as run_loop but calls decide_stream instead of decide, emitting LoopEvent::StreamToken during the decision phase.

Requires the agent to implement SgrAgentStream.