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 |
|---|---|---|
name | String | 组名称(必填)。The group name (required) |
Builder返回当前实例,以支持链式调用。This builder for method chaining
源码Source
io/agentscope/core/tool/ToolGroup.java:197–200description
public Builder description(String description)
设置该配置项。
Sets the description of the tool group.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
description | String | 描述(类型 `String`)。The group description |
Builder返回当前实例,以支持链式调用。This builder for method chaining
源码Source
io/agentscope/core/tool/ToolGroup.java:208–211active
public Builder active(boolean active)
设置该配置项。
Sets the initial activation state.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
active | boolean | active(类型 `boolean`)。true for active (default), false for inactive |
Builder返回当前实例,以支持链式调用。This builder for method chaining
源码Source
io/agentscope/core/tool/ToolGroup.java:219–222scope
public Builder scope(ToolGroupScope scope)
设置范围的工具组。
Sets the scope of the tool group.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
scope | ToolGroupScope | 范围(类型 `ToolGroupScope`)。`ToolGroupScope#META` (default) for agent-managed, `ToolGroupScope#EXTERNAL` for developer-managed |
Builder返回当前实例,以支持链式调用。This builder for method chaining
源码Source
io/agentscope/core/tool/ToolGroup.java:231–234tools
public Builder tools(Set<String> tools)
设置工具。
Sets the initial set of tools in this group.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
tools | Set<String> | 工具列表(类型 `Set`)。The tool names (a defensive copy will be made) |
Builder返回当前实例,以支持链式调用。This builder for method chaining
源码Source
io/agentscope/core/tool/ToolGroup.java:242–245build
public ToolGroup build()
构建并返回最终实例。
Builds a new ToolGroup with the configured settings.
ToolGroup一种新的工具组实例。A new ToolGroup instance
NullPointerException可能抛出 `NullPointerException`。if name is null
源码Source
io/agentscope/core/tool/ToolGroup.java:253–255