pub fn supervised(
worker: AgentBuilder,
supervisor: AgentBuilder,
max_rounds: usize,
) -> ComposableExpand description
Supervised: worker with supervisor oversight loop.
The worker agent produces output, then the supervisor reviews it.
The loop repeats until the supervisor sets "approved" to true
in the state, or after max_rounds iterations.
This is semantically similar to review_loop but framed as a
worker-supervisor relationship rather than author-reviewer.
§Arguments
worker— The agent that performs the task.supervisor— The agent that oversees and approves work.max_rounds— Maximum number of worker-supervisor cycles.
§Example
ⓘ
let managed = supervised(
AgentBuilder::new("coder").instruction("Write the implementation"),
AgentBuilder::new("lead").instruction("Code review. Set approved=true if ready to merge."),
5,
);