★ Final Challenge
› Run the Team
50 ptsYour system is complete: role-prompted specialists from make_agent, a
researcher → writer pipeline, a critic that bounces weak drafts back under
a hard budget, and a router in front. The final challenge is the engine of
that system as one pure function — the pipeline threading of
run_pipeline fused with the bounded revision of revise_until_approved,
producing the append-only transcript from the shared-state lesson. As
always, the LLMs arrive as injected callables; the tests stub every one.
Implement run_team(task, pipeline, critic, max_rounds):
pipelineis a non-empty list of(name, agent)pairs; eachagenttakes one string and returns one string. Threadtaskthrough the pipeline exactly likerun_pipeline: first agent getstask, each next agent gets the previous output. Record each step as(name, output)in a transcript list.- Then review:
critic(current_output)returnsNoneto approve or a feedback string. On approval, stop. On feedback, call the last pipeline agent with the feedback string, append the new(last_agent_name, output)step to the transcript, and review again. - Perform at most
max_roundscritic reviews — a never-approving critic gets exactlymax_roundsreviews andmax_roundsrevisions, then the team ships what it has. - Return the full transcript. The team's answer is
transcript[-1][1]. - You may assume
max_rounds >= 1.
Log in to submit a solution and earn points.