Skip to main content

run

Function run 

Source
pub async fn run(
    prompts: Vec<Message>,
    context: &mut AgentContext,
    config: LoopConfig,
    hooks: &dyn AgentHooks,
) -> Vec<Message>
Expand description

Runs the loop for new prompt messages and returns every message it added.

Events go to hooks.on_event in order: agent_start, then per turn turn_start, the turn’s messages and tool executions, turn_end, and finally agent_end.