Policy¶
Generated from strands_robots.core.contracts.Policy at build.
Produce actions from an observation and an instruction.
A provider declares the frame it emits (action_frame) so the robot can
refuse a mismatch before motion, whether it consumes images, and how many
actions of each chunk the loop should execute before asking again
(actions_per_step > 1 makes it chunk-emitting, and RTC engages).
Shape: ABC: subclass it, implement the abstract members.
Declared attributes¶
| attribute | meaning |
|---|---|
requires_images: bool = True |
|
action_frame: UnitFrame | None = None |
|
frame_agnostic: bool = False |
True for a policy that emits in whatever frame the observation carries (the mock); preflight adopts the robot's. |
control_frequency: float | None = None |
|
actions_per_step: int = 1 |
|
provider: str = 'policy' |
Members¶
| signature | contract |
|---|---|
set_control_frequency(hz: float) -> None |
Tell the policy the executing loop's rate so latency becomes a step count. |
preflight(observation_keys: Sequence[str]) -> None |
Refuse, by name, an observation that lacks a key this policy needs. |
async get_actions(obs: Observation, instruction: str, **kwargs: Any) -> list[Action] abstract |
Return an ordered chunk of actions; a length-1 list is a single-step provider. |
close() -> None |
Release model handles and channels; idempotent. |
Where it is used¶
Contracts return typed values and raise strands_robots.core.errors; the agent envelope
is built in tools/. The types they exchange are in strands_robots.core.types; the
frame they agree on is UnitFrame. Why the shapes are what they are:
VISION.md.