包package
agentscope.toolagentscope.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