agent_loop
agent_loop(...) builds an agent loop and returns it as a Step.
Key parameters:
body(state, loop_state) -> statestop_condition(state) -> boolpolicy:LoopPolicy(iteration limits, checkpointing, budgets)name: step/agent name (used in tracing)agent_type: type string for agent events
LoopPolicy
Loop execution configuration:
max_iterationstimeout_secondscheckpoint_storecheckpoint_policyexecution_policy(budgets)
LoopState
Per-run loop state passed into the loop body:
iterationstart_timelast_checkpoint_idagent_run_id
simple_loop
Convenience wrapper when you don’t need LoopState inside the body.