类class
agentscope.toolToolGroup
class ToolGroup
源码Source
agentscope/tool/_tool_group.py:10–110工具组,让智能体以受控方式调用外部能力。位于 agentscope.tool 包。核心成员包括 list_skills。
In high-code scenarios, the tools argument accepts any child classes for ToolBase class, and the tool groups supports serialization.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
def __init__(name: Literal['basic'] | str, description: str | None = None, instructions: str | None = None, tools: list… | 初始化 `ToolGroup` 实例。 Initialize the tool group. |
属性摘要Attribute Summary
| 属性Attribute | 类型Type | 说明Description | 值Value |
|---|---|---|---|
name | Literal['basic'] | str | 名称字段。 | — |
description | str | `description` 字段。 | — |
instructions | str | None | 指令字段。 | — |
tools | list[ToolBase] | 工具字段。 | — |
skills_or_loaders | list[Skill | SkillLoaderBase] | `skills_or_loaders` 字段。 | — |
mcps | list[MCPClient] | `mcps` 字段。 | — |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
async def list_skills() -> list[Skill]async | 列出技能。 List all the skills in this tool group. |
构造器详情Constructor Detail
ToolGroup
def __init__(name: Literal['basic'] | str, description: str | None = None, instructions: str | None = None, tools: list[ToolBase] | None = None, skills_or_loaders: Sequence[str | Skill | SkillLoaderBase] | None = None, mcps: list[MCPClient] | None = None) -> None
初始化 ToolGroup 实例。
Initialize the tool group.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | Literal['basic'] | str | 工具组的名称。The name of the tool group. |
description默认default None | str | None | 描述(类型 `str | None`)。The description of the tool group. |
instructions默认default None | str | None | 指令(类型 `str | None`)。Instructions included in the meta tool's result upon activation of this tool group, guiding the agent on how to properly use the meta tool. |
tools默认default None | list[ToolBase] | None | 工具 in 此组。The tools in this group. |
skills_or_loaders默认default None | Sequence[str | Skill | SkillLoaderBase] | None | 技能或 loaders(类型 `Sequence[str | Skill | SkillLoaderBase] | None`)。The skill paths, data, and loaders to access skills in this group. |
mcps默认default None | list[MCPClient] | None | mcps(类型 `list[MCPClient] | None`)。The mcps in this group. |
源码Source
agentscope/tool/_tool_group.py:41–99属性详情Attribute Detail
name
Literal['basic'] | str名称字段。声明为 Literal['basic'] | str。
The name field.
源码Source
agentscope/tool/_tool_group.py:19description
strdescription 字段。声明为 str。
The description field.
源码Source
agentscope/tool/_tool_group.py:23instructions
str | None指令字段。声明为 str | None。
The instructions field.
源码Source
agentscope/tool/_tool_group.py:28tools
list[ToolBase]工具字段。声明为 list[ToolBase]。
The tools field.
源码Source
agentscope/tool/_tool_group.py:32skills_or_loaders
list[Skill | SkillLoaderBase]skills_or_loaders 字段。声明为 list[Skill | SkillLoaderBase]。
The skills or loaders field.
源码Source
agentscope/tool/_tool_group.py:35mcps
list[MCPClient]mcps 字段。声明为 list[MCPClient]。
The mcps field.
源码Source
agentscope/tool/_tool_group.py:38方法详情Method Detail
list_skills
async def list_skills() -> list[Skill]
async
列出技能。
List all the skills in this tool group.
list[Skill]
返回技能列表。Returns a list of skill.
源码Source
agentscope/tool/_tool_group.py:101–110