AS AgentScopeAPI 手册 / API Reference
包package agentscope.tool

agentscope.tool

module agentscope.tool

agentscope.tool 属于工具与技能,工具注册、schema 与执行。 该包共收录 32 个公开类型。

The tool module in agentscope.

源码Source agentscope/tool/__init__.py:1

类Classes

AskUser
类class
Ask 用户,让智能体以受控方式调用外部能力。
The tool to collect information from the user via multiple-choice questions.
AskUserAnswer
类class
Ask 用户答案,让智能体以受控方式调用外部能力。
One question's answer, as the caller must return it.
AskUserMetadata
类class
Ask 用户元数据,让智能体以受控方式调用外部能力。
What the caller must put in ``ToolResultBlock.metadata``.
AskUserParams
类class
Ask 用户参数,让智能体以受控方式调用外部能力。
What a caller asks for — the questions, and their options.
BackendBase
类class
Backend 基类,让智能体以受控方式调用外部能力。
Filesystem + subprocess interface consumed by builtin tools.
Bash
类class
Bash,让智能体以受控方式调用外部能力。
The bash tool.
DirEntry
类class
目录条目,让智能体以受控方式调用外部能力。
One entry from :meth:`BackendBase.scandir`.
Edit
类class
Edit,让智能体以受控方式调用外部能力。
The edit tool for performing exact string replacements in files.
ExecResult
类class
Exec 结果,让智能体以受控方式调用外部能力。
Result of running a shell command via a backend.
FunctionTool
类class
函数工具适配器
Adapter to convert a Python function to ToolProtocol.
Glob
类class
Glob,让智能体以受控方式调用外部能力。
The glob tool for fast file pattern matching.
Grep
类class
Grep,让智能体以受控方式调用外部能力。
The grep tool for searching file contents using ripgrep.
LocalBackend
类class
本地 Backend,让智能体以受控方式调用外部能力。
Host-local :class:`BackendBase` implementation.
MCPTool
类class
MCP 工具,封装可被智能体调用的能力。
Adapter to convert an MCP tool to ToolProtocol.
ParamsBase
类class
参数基类,让智能体以受控方式调用外部能力。
A base class for tool parameters that remove the title field from the exported JSON schema.
PowerShell
类class
Power Shell,让智能体以受控方式调用外部能力。
Execute PowerShell commands through a workspace backend.
Read
类class
读取工具。
The read tool.
RegisteredTool
类class
已注册工具,封装可被智能体调用的能力。
The registered tool function class, used to store the tool function and its registration information.
ResetTools
类class
重置工具,封装可被智能体调用的能力。
A meta tool allows agent to self-manage its equipped tools by activating or deactivating tool groups dynamically.
TaskCreate
类class
任务创建,让智能体以受控方式调用外部能力。
Create a task for the agent to perform.
TaskGet
类class
任务读取,让智能体以受控方式调用外部能力。
Retrieve a task by its ID from the task list.
TaskList
类class
任务列表,让智能体以受控方式调用外部能力。
List tasks for the agent to perform.
TaskUpdate
类class
工具到更新智能体任务。
The tool to update the agent task.
ToolBase
类class
工具协议。
The tool protocol.
ToolChoice
类class
工具选项配置。
The tool choice configuration.
ToolChunk
类class
工具结果分块来自工具执行。
The tool result chunk from a tool execution.
ToolGroup
类class
工具组,让智能体以受控方式调用外部能力。
A group of related tools, mcps, and skills that an agent can activate, deactivate and use together. The tool group is activated by the meta tool `ResetTools`.
ToolMiddlewareBase
类class
工具中间件基类,让智能体以受控方式调用外部能力。
Base class for tool middlewares.
ToolResponse
类class
工具执行结果
The tool response from a tool execution, which contains the completed tool result (compared to ToolChunk).
Toolkit
类class
工具注册表
Toolkit is the core module to register, manage and delete tool functions, MCP clients, Agent skills in AgentScope.
Write
类class
写入工具。
The write tool.

属性Attributes

Function
字段attribute
—

属性详情Attribute Details

Function

TypeAlias = Callable[..., ToolChunk] | Callable[..., Awaitable[ToolChunk]] | Callable[..., Generator[ToolChunk, None, None]] | Callable[..., AsyncGenerator[ToolChunk, None]] | Callable[..., Coroutine[Any, Any, AsyncGenerator[ToolChunk, None]]] | Callable[..., Coroutine[Any, Any, Generator[ToolChunk, None, None]]]

函数字段。声明为 TypeAlias。

The function field.

源码Source agentscope/tool/_types.py:157
基于官方固定版本源码静态生成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.