AS AgentScopeAPI 手册 / API Reference
类class agentscope.tool

TaskCreate

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
namestr
名称字段。
'TaskCreate'
descriptionstr
`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_schemadict
输入模式字段。
_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:28

description

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:30

input_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_stateAgentState智能体状态(类型 `AgentState`)。The agent state.
subjectstr主题(类型 `str`)。The subject.
descriptionstr描述(类型 `str`)。The description.
metadata默认default Nonedict[str, Any] | None元数据(类型 `dict[str, Any] | None`)。The metadata.
返回Returns ToolChunk
返回ToolChunk。Returns tool chunk.
源码Source agentscope/tool/_task/_create_task.py:83–132
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.