跳转到内容

正在加载搜索…

Skills and prompts

此内容尚不支持你的语言。

Skills: the API a model’s programs call.

A skill is a package skills/<name>/ in the source checkout with

skill.toml name, summary, layer, the names it exports, what it needs
__init__.py a mixin class with the methods (and optional exports(session) and
turn_report(session): what the skill adds to the model's next turn
after every program)

A skill runs on the embodiment kinds its embodiments names (default robot). The kernel’s session class is the embodiment’s session (runtime/episode.py) plus the mixin of every skill for that embodiment, so skills can call each other’s methods. Which skills a program sees is decided per run: the system names them (or the interface layers do), and a skill whose services are missing, or that does not run on the run’s embodiment, is dropped, from the kernel namespace and from the prompt alike (runtime/prompts.py), so the model never reads about an API it cannot call.

class Skill

A skill as its skill.toml declares it (SKILL_KEYS); path is its directory.

def public() -> tuple[str, ...]

The exports without a leading underscore: the API programs are told about (the driver’s hook __wrap_up__ is left out).

def load_skills(root: Path=SKILLS_ROOT) -> dict[str, Skill]

Every skill under root, in prompt order.

def skills_for_layers(layers: dict | None, root: Path=SKILLS_ROOT, *, embodiment: str='robot') -> list[str]

The skills of an interface rung given as layer switches ({“learned”: bool, …}; defaults: learned off, reactive and handlers on) for an embodiment kind, without the optional ones.

def available_services(options: dict) -> set[str]

Service kinds a kernel’s options provide: the segmenter, pointer, VLM and verifier configs, and at least one policy, world model or MCP server.

class Resolution

The outcome of resolve: the enabled skills in prompt order, and each dropped skill with the reason.

def to_dict() -> dict

The resolution as a plain dict.

def resolve(requested, services: set[str], *, strict: bool=False, root: Path=SKILLS_ROOT, embodiment: str='robot') -> Resolution

The requested skills that can run on this embodiment kind with these services. A skill is dropped when it does not run on the embodiment, a service it needs is missing or a skill it requires is not enabled (repeated until nothing changes); the embodiment’s required skills are always enabled. strict: dropping is an error (evaluation runs must not run a smaller system than the one they name).

def mixins(root: Path=SKILLS_ROOT, *, embodiment: str='robot') -> list[type]

The mixin class of every skill for an embodiment kind, imported, in the skills’ order (the session’s method resolution order).

def namespace(session, names, root: Path=SKILLS_ROOT) -> dict

The kernel namespace of a session with the skills names enabled: each skill’s exports(session) when its module defines one, else the session attributes it exports.

def reporters(names, root: Path=SKILLS_ROOT) -> list

The turn reports of the skills names, in skill order: each skill module’s turn_report(session) -> {“text”, “images”} or None, which the session calls after every program (EpisodeCore.drain).

def exported_names(root: Path=SKILLS_ROOT) -> dict[str, tuple[str, ...]]

Every exported name and the skills that export it (more than one only for skills that conflict).

System prompts assembled from a prompt pack for the skills a run enables.

A pack is a directory of Markdown sections (prompts/robodojo, prompts/robotwin). Its pack.toml lists the sections in order; a section with skills is included only when one of them is enabled:

sections = [
{ file = "core.md" },
{ file = "learned.md", skills = ["vla", "wam"] },
{ file = "rules_learned.md", skills = ["vla"], optional = true },
]

Inside a section, lines can be kept for some skills only:

&lt;!-- if: pointing, segmentation --&gt; kept when all named skills are enabled
...
&lt;!-- else --&gt; kept otherwise (optional)
...
&lt;!-- end --&gt;

Markers may also name features of the robot connection (FEATURES): measured_gripper holds when gripper readings are measured openings, not under a contract that reports only the last command, and step_limit when the episode’s step limit is reported (core/contract.py). The marker lines themselves never reach the model, so a prompt with every skill and feature enabled is the pack’s text without them. The API documentation stays in the pack because it describes one embodiment (its frames, reach and numbers); the skills’ code is the same for every embodiment.

def features_for(runtime: dict) -> set[str]

The prompt features of a runtime configuration (its observation contract).

def pack(directory: Path) -> dict

The pack’s settings: sections and the exported names it leaves undocumented.

def sections(directory: Path) -> list[dict]

The pack’s sections in order ({“file”, and optionally “skills”, “optional”}): pack.toml’s, or DEFAULT_SECTIONS without one.

def select(text: str, skills) -> str

Keep the lines of text whose if/else markers hold for the enabled skills.

def marked_skills(text: str) -> set[str]

Skills named in the markers of text.

def assemble_prompt(directory: Path, skills, overrides: dict | None=None, features=('measured_gripper',)) -> str

The pack’s sections for the enabled skills and connection features, joined. overrides maps a section name (file stem) to another file, e.g. another embodiment’s core section.

def mentions(text: str, name: str) -> bool

Whether the prompt refers to an API name: a call for functions, the bare word for constants (upper case).

def documentation_gaps(directory: Path, skills, exported: dict, features=('measured_gripper',)) -> dict

What the assembled prompt gets wrong about the API: missing are functions of enabled skills it never shows being called (except those the pack lists as undocumented), stray are names of disabled skills it still mentions. exported maps each exported name to its skill, or to the skills that export it.