S SmartDocs
系列: Humanoid python 95 行 · 更新於 2026-05-12

prompts.py

Humanoid/May_12/RoboOS/master/agents/prompts.py

MASTER_PLANNING_PLANNING = """

Please only use {robot_name_list} with skills {robot_tools_info}.
You must also consider the following scene information when decomposing the task:
{scene_info}

Please break down the given task into sub-tasks, each of which cannot be too complex, make sure that a single robot can do it.
Each sub-task in the output needs a concise name of the sub-task, which includes the robots that need to complete the sub-task. 
Additionally you need to give a 200+ word reasoning explanation on subtask decomposition and analyze if each step can be done by a single robot based on each robot's tools!

## The output format is as follows, in the form of a JSON structure:
{{
    "reasoning_explanation": xxx,
    "subtask_list": [
        {{"robot_name": xxx, "subtask": xxx, "subtask_order": xxx}},
        {{"robot_name": xxx, "subtask": xxx, "subtask_order": xxx}},
        {{"robot_name": xxx, "subtask": xxx, "subtask_order": xxx}},
    ]
}}

## Note: 'subtask_order' means the order of the sub-task. 
If the tasks are not sequential, please set the same 'task_order' for the same task. For example, if two robots are assigned to the two tasks, both of which are independance, they should share the same 'task_order'.
If the tasks are sequential, the 'task_order' should be set in the order of execution. For example, if the task_2 should be started after task_1, they should have different 'task_order'.

# The task to be completed is: {task}. Your output answer:
"""


PACKAGE_SORTING_PLANNING = """
You are a task planner for a humanoid robot performing package sorting between two conveyor belts.
Left conveyor = source (packages come in). Right conveyor = sink (packages go out).

## Goal
For each package on the left conveyor:
  1. PICK from left_conveyor
  2. REORIENT so that the barcode face is up (if not already up)
  3. PUSH onto right_conveyor

## Constraints
- A "Task" is one package (its 3 phases live inside one TaskRuntime FSM).
- Plan **at most 3 active packages** at a time. Extra packages go to the pending buffer.
- If a package's `barcode_face` is already `up`, skip the REORIENT subtask.
- Package priority = (1 / distance_to_gripper) * detection_score.
- Use only the robots in {robot_name_list}, with skills {robot_tools_info}.

## Scene snapshot
{scene_info}

## Output strictly the following JSON (no markdown, no extra text)
{{
    "reasoning_explanation": "<200+ words explaining: which packages, priority order, why each subtask is feasible>",
    "subtask_list": [
        {{
            "subtask_id": "t1",
            "robot_name": "<robot>",
            "subtask": "Pick package <package_id> from left_conveyor",
            "package_id": "<package_id>",
            "phase": "PICK",
            "subtask_order": 0,
            "priority": <float>,
            "depends_on": null
        }},
        {{
            "subtask_id": "t2",
            "robot_name": "<robot>",
            "subtask": "Rotate package <package_id> so barcode face is up",
            "package_id": "<package_id>",
            "phase": "REORIENT",
            "subtask_order": 1,
            "priority": <float>,
            "depends_on": "t1"
        }},
        {{
            "subtask_id": "t3",
            "robot_name": "<robot>",
            "subtask": "Push package <package_id> onto right_conveyor",
            "package_id": "<package_id>",
            "phase": "PUSH",
            "subtask_order": 2,
            "priority": <float>,
            "depends_on": "t2"
        }}
    ]
}}

## Field rules
- `subtask_id`: short string `t1`, `t2`, ... unique within this response.
- `phase`: one of `PICK` / `REORIENT` / `PUSH`.
- `package_id`: must come from the scene snapshot (e.g. `P_2026051200001`).
- `depends_on`: `subtask_id` of the prerequisite subtask, or `null`.

# Human instruction: {task}
# Your output answer:
"""

相關文章