类class
agentscope.toolTaskUpdate
class TaskUpdate(_TaskToolBase)
源码Source
agentscope/tool/_task/_update_task.py:54–298工具到更新智能体任务。位于 agentscope.tool 包,继承自 _TaskToolBase。核心成员包括 call。
The tool to update the agent task. Declared in agentscope.tool. Extends _TaskToolBase.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
name | str | 名称字段。 | 'TaskUpdate' |
description | str | `description` 字段。 | 'Use this tool to update a task in the task list.\n\n## When to Use This Tool\n\n**Mark tasks as resolved:**\n- When you have completed the work described in a task\n- When a task is no longer needed or has been superseded\n- IMPORTANT: Always mark your assigned tasks as resolved when you finish them\n- After resolving, call TaskList to find your next task\n\n- ONLY mark a task as completed when you have FULLY accomplished it\n- If you encounter errors, blockers, or cannot finish, keep the task as in_progress\n- When blocked, create a new task describing what needs to be resolved\n- Never mark a task as completed if:\n - Tests are failing\n - Implementation is partial\n - You encountered unresolved errors\n - You couldn\'t find necessary files or dependencies\n\n**Delete tasks:**\n- When a task is no longer relevant or was created in error\n- Setting status to `deleted` permanently removes the task\n\n**Update task details:**\n- When requirements change or become clearer\n- When establishing dependencies between tasks\n\n## Fields You Can Update\n\n- **status**: The task status (see Status Workflow below)\n- **subject**: Change the task title (imperative form, e.g., "Run tests")\n- **description**: Change the task description\n- **owner**: Change the task owner (agent name)\n- **metadata**: Merge metadata keys into the task (set a key to null to delete it)\n- **add_blocks**: Mark tasks that cannot start until this one completes\n- **add_blocked_by**: Mark tasks that must complete before this one can start\n\n## Status Workflow\n\nStatus progresses: `pending` → `in_progress` → `completed`\n\nUse `deleted` to permanently remove a task.\n\n## Staleness\n\nMake sure to read a task\'s latest state using `TaskGet` before updating it.\n\n## Examples\n\nMark task as in progress when starting work:\n```json\n{"task_id": "1", "status": "in_progress"}\n```\n\nMark task as completed after finishing work:\n```json\n{"task_id": "1", "status": "completed"}\n```\n\nDelete a task:\n```json\n{"task_id": "1", "status": "deleted"}\n```\n\nClaim a task by setting owner:\n```json\n{"task_id": "1", "owner": "my-name"}\n```\n\nSet up task dependencies:\n```json\n{"task_id": "2", "add_blocked_by": ["1"]}\n```' |
input_schema | dict | 输入模式字段。 | _TaskUpdateParams.model_json_schema() |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
async def call(_agent_state: AgentState, task_id: str, subject: str | None = None, description: str | None = None, add_…async | 向智能体发送输入并返回最终回复。 Update the agent task. |
属性详情Attribute Detail
name
str = 'TaskUpdate'名称字段。声明为 str。
The name field.
源码Source
agentscope/tool/_task/_update_task.py:57description
str = 'Use this tool to update a task in the task list.\n\n## When to Use This Tool\n\n**Mark tasks as resolved:**\n- When you have completed the work described in a task\n- When a task is no longer needed or has been superseded\n- IMPORTANT: Always mark your assigned tasks as resolved when you finish them\n- After resolving, call TaskList to find your next task\n\n- ONLY mark a task as completed when you have FULLY accomplished it\n- If you encounter errors, blockers, or cannot finish, keep the task as in_progress\n- When blocked, create a new task describing what needs to be resolved\n- Never mark a task as completed if:\n - Tests are failing\n - Implementation is partial\n - You encountered unresolved errors\n - You couldn\'t find necessary files or dependencies\n\n**Delete tasks:**\n- When a task is no longer relevant or was created in error\n- Setting status to `deleted` permanently removes the task\n\n**Update task details:**\n- When requirements change or become clearer\n- When establishing dependencies between tasks\n\n## Fields You Can Update\n\n- **status**: The task status (see Status Workflow below)\n- **subject**: Change the task title (imperative form, e.g., "Run tests")\n- **description**: Change the task description\n- **owner**: Change the task owner (agent name)\n- **metadata**: Merge metadata keys into the task (set a key to null to delete it)\n- **add_blocks**: Mark tasks that cannot start until this one completes\n- **add_blocked_by**: Mark tasks that must complete before this one can start\n\n## Status Workflow\n\nStatus progresses: `pending` → `in_progress` → `completed`\n\nUse `deleted` to permanently remove a task.\n\n## Staleness\n\nMake sure to read a task\'s latest state using `TaskGet` before updating it.\n\n## Examples\n\nMark task as in progress when starting work:\n```json\n{"task_id": "1", "status": "in_progress"}\n```\n\nMark task as completed after finishing work:\n```json\n{"task_id": "1", "status": "completed"}\n```\n\nDelete a task:\n```json\n{"task_id": "1", "status": "deleted"}\n```\n\nClaim a task by setting owner:\n```json\n{"task_id": "1", "owner": "my-name"}\n```\n\nSet up task dependencies:\n```json\n{"task_id": "2", "add_blocked_by": ["1"]}\n```'description 字段。声明为 str。
The description field.
源码Source
agentscope/tool/_task/_update_task.py:59input_schema
dict = _TaskUpdateParams.model_json_schema()输入模式字段。声明为 dict。
The input schema field.
源码Source
agentscope/tool/_task/_update_task.py:133方法详情Method Detail
call
async def call(_agent_state: AgentState, task_id: str, subject: str | None = None, description: str | None = None, add_blocks: list[str] | None = None, status: Literal['pending', 'completed', 'in_progress', 'deleted'] | None = None, add_blocked_by: list[str] | None = None, owner: str | None = None, metadata: dict | None = None) -> ToolChunk
async
向智能体发送输入并返回最终回复。
Update the agent task.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
_agent_state | AgentState | 智能体状态(类型 `AgentState`)。The agent state. |
task_id | str | 任务标识(类型 `str`)。The task id. |
subject默认default None | str | None | 主题(类型 `str | None`)。The subject. |
description默认default None | str | None | 描述(类型 `str | None`)。The description. |
add_blocks默认default None | list[str] | None | 添加 blocks(类型 `list[str] | None`)。The add blocks. |
status默认default None | Literal['pending', 'completed', 'in_progress', 'deleted'] | None | 状态(类型 `Literal['pending', 'completed', 'in_progress', 'deleted'] | None`)。The status. |
add_blocked_by默认default None | list[str] | None | 添加 blocked 通过(类型 `list[str] | None`)。The add blocked by. |
owner默认default None | str | None | 所有者(类型 `str | None`)。The owner. |
metadata默认default None | dict | None | 元数据(类型 `dict | None`)。The metadata. |
ToolChunk
返回ToolChunk。Returns tool chunk.
源码Source
agentscope/tool/_task/_update_task.py:135–274