trading_agent.tools.delegate_task_tool
¶
The delegate_task tool: hands one to four self-contained tasks to subagents, which run side by side.
Typical usage example:
tool = DelegateTaskTool(subagent_runner)
DelegatedTask
¶
Bases: BaseModel
One task for one subagent.
Attributes:
| Name | Type | Description |
|---|---|---|
subagent |
str
|
The subagent's name, from the Subagents section of your instructions. |
task |
str
|
What it should do, with every fact it needs; it cannot see your conversation. |
DelegateTaskArguments
¶
Bases: BaseModel
The arguments of delegate_task.
Attributes:
| Name | Type | Description |
|---|---|---|
tasks |
list[DelegatedTask]
|
One to four tasks, run at the same time. |
DelegateTaskTool
¶
Bases: Tool
Runs subagent tasks and returns their reports.
Creates the tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
runner
|
SubagentRunner
|
The desk's subagent runner. |
required |
Source code in src/trading_agent/tools/delegate_task_tool.py
run
async
¶
Runs the tasks and joins their reports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
DelegateTaskArguments
|
The tasks. |
required |
Returns:
| Type | Description |
|---|---|
ToolResult
|
One block per task; an error only when no task produced a report. |