类class
agentscope.toolTaskCreate
class TaskCreate(_TaskToolBase)
源码Source
agentscope/tool/_task/_create_task.py:25–132任务创建,让智能体以受控方式调用外部能力。位于 agentscope.tool 包,继承自 _TaskToolBase。核心成员包括 call。
Create a task for the agent to perform. Declared in agentscope.tool. Extends _TaskToolBase.
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
name | str | 名称字段。 | 'TaskCreate' |
description | str | `description` 字段。 | 'Use this tool to create a structured task list for your current session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\nIt also helps the user understand the progress of the task and overall progress of their requests.\n\n## When to Use This Tool\nUse this tool proactively in these scenarios:\n\n- Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n- Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n- Plan mode - When using plan mode, create a task list to track the work\n- User explicitly requests todo list - When the user directly asks you to use the todo list\n- User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n- After receiving new instructions - Immediately capture user requirements as tasks\n- When you start working on a task - Mark it as in_progress BEFORE beginning work\n- After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation\n\n## When NOT to Use This Tool\n\nSkip using this tool when:\n- There is only **one single, straightforward** task\n- The task is trivial and tracking it provides no organizational benefit\n- The task can be completed in less than 3 trivial steps\n- The task is purely conversational or informational\n\nNOTE that you should **NOT** use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n\n## Task Fields\n\n- **subject**: A brief, actionable title in imperative form (e.g., "Fix authentication bug in login flow")\n- **description**: What needs to be done\n\nAll tasks are created with status `pending`.\n\n## Tips\n\n- Create tasks with clear, specific subjects that describe the outcome\n- After creating tasks, use TaskUpdate to set up dependencies (blocks/blockedBy) if needed\n- Check TaskList first to avoid creating duplicate tasks' |
input_schema | dict | 输入模式字段。 | _TaskCreateParams.model_json_schema() |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
async def call(_agent_state: AgentState, subject: str, description: str, metadata: dict[str, Any] | None = None) -> Too…async | 向智能体发送输入并返回最终回复。 Create the subtask and add it into the agent state. |
属性详情Attribute Detail
name
str = 'TaskCreate'名称字段。声明为 str。
The name field.
源码Source
agentscope/tool/_task/_create_task.py:28description
str = 'Use this tool to create a structured task list for your current session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\nIt also helps the user understand the progress of the task and overall progress of their requests.\n\n## When to Use This Tool\nUse this tool proactively in these scenarios:\n\n- Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n- Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n- Plan mode - When using plan mode, create a task list to track the work\n- User explicitly requests todo list - When the user directly asks you to use the todo list\n- User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n- After receiving new instructions - Immediately capture user requirements as tasks\n- When you start working on a task - Mark it as in_progress BEFORE beginning work\n- After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation\n\n## When NOT to Use This Tool\n\nSkip using this tool when:\n- There is only **one single, straightforward** task\n- The task is trivial and tracking it provides no organizational benefit\n- The task can be completed in less than 3 trivial steps\n- The task is purely conversational or informational\n\nNOTE that you should **NOT** use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n\n## Task Fields\n\n- **subject**: A brief, actionable title in imperative form (e.g., "Fix authentication bug in login flow")\n- **description**: What needs to be done\n\nAll tasks are created with status `pending`.\n\n## Tips\n\n- Create tasks with clear, specific subjects that describe the outcome\n- After creating tasks, use TaskUpdate to set up dependencies (blocks/blockedBy) if needed\n- Check TaskList first to avoid creating duplicate tasks'description 字段。声明为 str。
The description field.
源码Source
agentscope/tool/_task/_create_task.py:30input_schema
dict = _TaskCreateParams.model_json_schema()输入模式字段。声明为 dict。
The input schema field.
源码Source
agentscope/tool/_task/_create_task.py:81方法详情Method Detail
call
async def call(_agent_state: AgentState, subject: str, description: str, metadata: dict[str, Any] | None = None) -> ToolChunk
async
向智能体发送输入并返回最终回复。
Create the subtask and add it into the agent state.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
_agent_state | AgentState | 智能体状态(类型 `AgentState`)。The agent state. |
subject | str | 主题(类型 `str`)。The subject. |
description | str | 描述(类型 `str`)。The description. |
metadata默认default None | dict[str, Any] | None | 元数据(类型 `dict[str, Any] | None`)。The metadata. |
ToolChunk
返回ToolChunk。Returns tool chunk.
源码Source
agentscope/tool/_task/_create_task.py:83–132