Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit 278bb18

Browse files
author
astrbot-docs-agent[bot]
committed
docs: update for AstrBotDevs/AstrBot#5348
1 parent 7f682f5 commit 278bb18

File tree

2 files changed

+51
-3
lines changed

2 files changed

+51
-3
lines changed

en/use/subagent.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,30 @@ Click the "Add SubAgent" button:
4242
- **Assign Tools**: Select the tools this SubAgent can invoke.
4343
- **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.
4444

45+
## Delegation Tool Parameters
46+
47+
When the Main Agent calls a delegation tool (`transfer_to_<subagent_name>`), it can pass the following parameters:
48+
49+
| Parameter | Type | Required | Description |
50+
|-----------|------|----------|-------------|
51+
| `input` | string | Yes | The task description to be handed off to the SubAgent. Should be clear and concise. |
52+
| `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. |
53+
| `background_task` | boolean | No | Whether to execute as a background task. Background tasks run in the background and notify the Main Agent upon completion. |
54+
55+
### Image Parameter Example
56+
57+
The Main Agent can pass images when delegating tasks, useful for multimodal tasks requiring visual input:
58+
59+
```json
60+
{
61+
"input": "Generate a description based on this image",
62+
"image_urls": [
63+
"https://example.com/image.jpg",
64+
"/path/to/local/image.png"
65+
]
66+
}
67+
```
68+
4569
## Best Practices
4670

4771
- **Single Responsibility**: Each SubAgent should handle one category of related tasks (e.g., search, file processing, smart home control).

zh/use/subagent.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,42 @@ SubAgent 编排是 AstrBot 提供的一种高级 Agent 组织方式。它允许
3030

3131
### 1. 启用 SubAgent 模式
3232

33-
在页面顶部开启启用 SubAgent 编排
33+
在页面顶部开启"启用 SubAgent 编排"
3434

3535
### 2. 创建 SubAgent
3636

37-
点击新增 SubAgent按钮:
37+
点击"新增 SubAgent"按钮:
3838

3939
- **Agent 名称**:用于生成委派工具名(如 `transfer_to_weather`)。建议使用英文小写和下划线。
40-
- **选择 Persona**:选择一个预设的 Persona,即人格,作为该子 Agent 的基础性格、行为指导和可以使用的 Tools 集合。你可以在人格设定页面创建和管理 Persona。
40+
- **选择 Persona**:选择一个预设的 Persona,即人格,作为该子 Agent 的基础性格、行为指导和可以使用的 Tools 集合。你可以在"人格设定"页面创建和管理 Persona。
4141
- **对主 LLM 的描述**:这段描述会告诉主 Agent 这个子 Agent 擅长做什么,以便主 Agent 准确委派。
4242
- **分配工具**:选择该子 Agent 可以调用的工具。
4343
- **Provider 覆盖(可选)**:你可以为特定的子 Agent 指定不同的模型提供商。例如,主 Agent 使用 GPT-4o,而负责简单查询的子 Agent 使用 GPT-4o-mini 以节省成本。
4444

45+
## 委派工具参数
46+
47+
当主 Agent 调用委派工具(`transfer_to_<subagent_name>`)时,可以传递以下参数:
48+
49+
| 参数 | 类型 | 必填 | 说明 |
50+
|------|------|------|------|
51+
| `input` | string || 要传递给子 Agent 的任务描述,应清晰简洁。 |
52+
| `image_urls` | array || 图片源列表,支持公开 HTTP URL 或本地文件路径,用于多模态任务(如视频生成参考图)。 |
53+
| `background_task` | boolean || 是否作为后台任务执行。后台任务会在后台运行,完成后通知主 Agent。 |
54+
55+
### 图片参数示例
56+
57+
主 Agent 可以在委派任务时传递图片,适用于需要视觉输入的多模态任务:
58+
59+
```json
60+
{
61+
"input": "根据这张图片生成一段描述",
62+
"image_urls": [
63+
"https://example.com/image.jpg",
64+
"/path/to/local/image.png"
65+
]
66+
}
67+
```
68+
4569
## 最佳实践
4670

4771
- **职责单一**:每个 SubAgent 应该只负责一类相关的任务(如:搜索、文件处理、智能家居控制)。

0 commit comments

Comments
 (0)