Skip to main content

agent_loop

Function agent_loop 

Source
pub async fn agent_loop(
    prompts: Vec<AgentMessage>,
    context: AgentContext,
    config: AgentLoopConfig,
    emit: &mut (dyn FnMut(AgentEvent) + Send),
    signal: &AbortSignal,
    stream_fn: &dyn StreamFn,
) -> Vec<AgentMessage>
Expand description

runAgentLoop: add prompts (after declaring tool changes) and run until the agent stops. Returns the new messages.