AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/tool/ToolGroup.java:183–256

构建器,用于构建并配置目标实例。位于 io.agentscope.core.tool 包。核心成员包括 name、description、active、scope、tools、build。

Builder for constructing ToolGroup instances.

方法摘要Method Summary

方法Method说明Description
public Builder name(String name)
设置名称的工具组。
Sets the name of the tool group.
public Builder description(String description)
设置该配置项。
Sets the description of the tool group.
public Builder active(boolean active)
设置该配置项。
Sets the initial activation state.
public Builder scope(ToolGroupScope scope)
设置范围的工具组。
Sets the scope of the tool group.
public Builder tools(Set<String> tools)
设置工具。
Sets the initial set of tools in this group.
public ToolGroup build()
构建并返回最终实例。
Builds a new ToolGroup with the configured settings.

方法详情Method Detail

name

public Builder name(String name)

设置名称的工具组。

Sets the name of the tool group.

参数Parameters
名称Name类型Type说明Description
nameString组名称(必填)。The group name (required)
返回Returns Builder
返回当前实例,以支持链式调用。This builder for method chaining
源码Source io/agentscope/core/tool/ToolGroup.java:197–200

description

public Builder description(String description)

设置该配置项。

Sets the description of the tool group.

参数Parameters
名称Name类型Type说明Description
descriptionString描述(类型 `String`)。The group description
返回Returns Builder
返回当前实例,以支持链式调用。This builder for method chaining
源码Source io/agentscope/core/tool/ToolGroup.java:208–211

active

public Builder active(boolean active)

设置该配置项。

Sets the initial activation state.

参数Parameters
名称Name类型Type说明Description
activebooleanactive(类型 `boolean`)。true for active (default), false for inactive
返回Returns Builder
返回当前实例,以支持链式调用。This builder for method chaining
源码Source io/agentscope/core/tool/ToolGroup.java:219–222

scope

public Builder scope(ToolGroupScope scope)

设置范围的工具组。

Sets the scope of the tool group.

参数Parameters
名称Name类型Type说明Description
scopeToolGroupScope范围(类型 `ToolGroupScope`)。`ToolGroupScope#META` (default) for agent-managed, `ToolGroupScope#EXTERNAL` for developer-managed
返回Returns Builder
返回当前实例,以支持链式调用。This builder for method chaining
源码Source io/agentscope/core/tool/ToolGroup.java:231–234

tools

public Builder tools(Set<String> tools)

设置工具。

Sets the initial set of tools in this group.

参数Parameters
名称Name类型Type说明Description
toolsSet<String>工具列表(类型 `Set`)。The tool names (a defensive copy will be made)
返回Returns Builder
返回当前实例,以支持链式调用。This builder for method chaining
源码Source io/agentscope/core/tool/ToolGroup.java:242–245

build

public ToolGroup build()

构建并返回最终实例。

Builds a new ToolGroup with the configured settings.

返回Returns ToolGroup
一种新的工具组实例。A new ToolGroup instance
抛出Throws
  • NullPointerException 可能抛出 `NullPointerException`。if name is null
源码Source io/agentscope/core/tool/ToolGroup.java:253–255
基于官方固定版本源码静态生成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.