strands.multiagent.spec
Multi-Agent Specification and Resolution.
Provides the authority-mode system for model-driven multi-agent patterns, where the model configures child agents at runtime. The developer sets axis policies that shape the parameters the model sees and govern what values it can supply:
Fixed— developer-pinned value; hidden from the model.Inherit— value taken from the parent agent; hidden from the model.Open— model supplies a free-form value.Choice— model picks from a developer-supplied set.
_resolve_spec merges model-supplied arguments, preset defaults, and axis policies
into a fully resolved AgentSpec used to build child agents. Inherit axes resolve
to None (meaning “inherit all”); the class is a self-documenting marker.
@dataclass(frozen=True)class Fixed()Defined in: src/strands/multiagent/spec.py:39
The developer pins the value; the axis contributes no model-facing parameter.
Inherit
Section titled “Inherit”@dataclass(frozen=True)class Inherit()Defined in: src/strands/multiagent/spec.py:46
The child takes the parent’s value; the axis contributes no model-facing parameter.
@dataclass(frozen=True)class Open()Defined in: src/strands/multiagent/spec.py:51
The model writes the value freely; the axis contributes a string parameter.
Option
Section titled “Option”@dataclass(frozen=True)class Option()Defined in: src/strands/multiagent/spec.py:56
A selectable entry in a Choice.
Choice
Section titled “Choice”@dataclass(frozen=True)class Choice()Defined in: src/strands/multiagent/spec.py:65
The model picks from a developer-supplied set.
Each entry is a bare name or an Option. Set multiple=True to let the model
pick more than one.
normalized
Section titled “normalized”def normalized() -> list[Option]Defined in: src/strands/multiagent/spec.py:75
The options as Options with value resolved, wrapping any bare name.
to_schema_property
Section titled “to_schema_property”def to_schema_property(description: str = "") -> dict[str, Any]Defined in: src/strands/multiagent/spec.py:87
Render this axis as a JSON Schema property for a tool’s inputSchema.
Produces a string enum (or array of enum when multiple), with per-option
descriptions folded into the property’s description.
value_for
Section titled “value_for”def value_for(name: str) -> AnyDefined in: src/strands/multiagent/spec.py:109
The resolved value behind name, or name itself if unknown.
Preset
Section titled “Preset”@dataclass(frozen=True)class Preset()Defined in: src/strands/multiagent/spec.py:118
A named role: a partially applied child configuration selected via agent_type.
AgentSpec
Section titled “AgentSpec”@dataclassclass AgentSpec()Defined in: src/strands/multiagent/spec.py:128
The resolved child configuration handed to the builder.