From 278bb1857be37a1124686ee4f9794681e2eb584b Mon Sep 17 00:00:00 2001 From: "astrbot-docs-agent[bot]" Date: Mon, 23 Feb 2026 14:30:42 +0000 Subject: [PATCH] docs: update for AstrBotDevs/AstrBot#5348 --- en/use/subagent.md | 24 ++++++++++++++++++++++++ zh/use/subagent.md | 30 +++++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 3 deletions(-) diff --git a/en/use/subagent.md b/en/use/subagent.md index da6e5a7..9b5a96e 100644 --- a/en/use/subagent.md +++ b/en/use/subagent.md @@ -42,6 +42,30 @@ Click the "Add SubAgent" button: - **Assign Tools**: Select the tools this SubAgent can invoke. - **Provider Override (Optional)**: You can specify different model providers for specific SubAgents. For example, the Main Agent could use GPT-4o, while a simple query SubAgent uses GPT-4o-mini to save costs. +## Delegation Tool Parameters + +When the Main Agent calls a delegation tool (`transfer_to_`), it can pass the following parameters: + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `input` | string | Yes | The task description to be handed off to the SubAgent. Should be clear and concise. | +| `image_urls` | array | No | An array of image sources (public HTTP URLs or local file paths) used as references in multimodal tasks such as video generation. | +| `background_task` | boolean | No | Whether to execute as a background task. Background tasks run in the background and notify the Main Agent upon completion. | + +### Image Parameter Example + +The Main Agent can pass images when delegating tasks, useful for multimodal tasks requiring visual input: + +```json +{ + "input": "Generate a description based on this image", + "image_urls": [ + "https://example.com/image.jpg", + "/path/to/local/image.png" + ] +} +``` + ## Best Practices - **Single Responsibility**: Each SubAgent should handle one category of related tasks (e.g., search, file processing, smart home control). diff --git a/zh/use/subagent.md b/zh/use/subagent.md index 5c2a20d..111050d 100644 --- a/zh/use/subagent.md +++ b/zh/use/subagent.md @@ -30,18 +30,42 @@ SubAgent 编排是 AstrBot 提供的一种高级 Agent 组织方式。它允许 ### 1. 启用 SubAgent 模式 -在页面顶部开启“启用 SubAgent 编排”。 +在页面顶部开启"启用 SubAgent 编排"。 ### 2. 创建 SubAgent -点击“新增 SubAgent”按钮: +点击"新增 SubAgent"按钮: - **Agent 名称**:用于生成委派工具名(如 `transfer_to_weather`)。建议使用英文小写和下划线。 -- **选择 Persona**:选择一个预设的 Persona,即人格,作为该子 Agent 的基础性格、行为指导和可以使用的 Tools 集合。你可以在“人格设定”页面创建和管理 Persona。 +- **选择 Persona**:选择一个预设的 Persona,即人格,作为该子 Agent 的基础性格、行为指导和可以使用的 Tools 集合。你可以在"人格设定"页面创建和管理 Persona。 - **对主 LLM 的描述**:这段描述会告诉主 Agent 这个子 Agent 擅长做什么,以便主 Agent 准确委派。 - **分配工具**:选择该子 Agent 可以调用的工具。 - **Provider 覆盖(可选)**:你可以为特定的子 Agent 指定不同的模型提供商。例如,主 Agent 使用 GPT-4o,而负责简单查询的子 Agent 使用 GPT-4o-mini 以节省成本。 +## 委派工具参数 + +当主 Agent 调用委派工具(`transfer_to_`)时,可以传递以下参数: + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `input` | string | 是 | 要传递给子 Agent 的任务描述,应清晰简洁。 | +| `image_urls` | array | 否 | 图片源列表,支持公开 HTTP URL 或本地文件路径,用于多模态任务(如视频生成参考图)。 | +| `background_task` | boolean | 否 | 是否作为后台任务执行。后台任务会在后台运行,完成后通知主 Agent。 | + +### 图片参数示例 + +主 Agent 可以在委派任务时传递图片,适用于需要视觉输入的多模态任务: + +```json +{ + "input": "根据这张图片生成一段描述", + "image_urls": [ + "https://example.com/image.jpg", + "/path/to/local/image.png" + ] +} +``` + ## 最佳实践 - **职责单一**:每个 SubAgent 应该只负责一类相关的任务(如:搜索、文件处理、智能家居控制)。