Start For Each • AI Agent SDK

start_for_each: Run this team once per input dict, interpolating “key“ placeholders.

start_for_each

Method

</div>

This is a method of the AgentTeam class in the agents module.

Run this team once per input dict, interpolating `&#123;&#123;key&#125;&#125;` placeholders.

Each input dict is applied as per-run `variables (existing &#123;&#123;placeholder&#125;&#125;` interpolation in task descriptions), so the original task templates are never permanently mutated.

Signature

python
def start_for_each(inputs: Any) -> Any

Parameters

ParamField Any

List of dicts; each runs the team once with those variables.

Returns

ResponseField Any

dict with `batch_id, items (per-item index/input/ success/output/error), outputs, succeeded, failed, total and token_usage_total`.

Uses

  • ValueError
  • start_for_each
  • uuid.uuid4
  • start

Used By

Source

View on GitHub

praisonaiagents/agents/agents.py at line 3004