Builder
public static class Builder
源码Source
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:224–264构建器,用于构建并配置目标实例。位于 io.agentscope.runtime.sandbox.tools 包。核心成员包括 serverConfigs、sandboxType、whitelist、blacklist、sandboxService、build。
A class in io.agentscope.runtime.sandbox.tools that lets agents invoke external capabilities under control. Declared in io.agentscope.runtime.sandbox.tools.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder serverConfigs(Map<String, Object> serverConfigs) | 设置该配置项。 Performs the server configs operation. |
public Builder serverConfigs(String serverConfigsStr) | 设置该配置项。 Performs the server configs operation. |
public Builder sandboxType(String sandboxType) | 设置沙箱类型。 Performs the sandbox type operation. |
public Builder whitelist(Set<String> whitelist) | 设置该配置项。 Performs the whitelist operation. |
public Builder blacklist(Set<String> blacklist) | 设置该配置项。 Performs the blacklist operation. |
public Builder sandboxService(SandboxService sandboxService) | 设置沙箱服务。 Performs the sandbox service operation. |
public McpConfigConverter build() | 构建并返回最终实例。 Creates and returns an instance. |
方法详情Method Detail
serverConfigs
public Builder serverConfigs(Map<String, Object> serverConfigs)
设置该配置项。
Performs the server configs operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
serverConfigs | Map<String, Object> | 服务端 Configs(类型 `Map`)。The server configs. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:231–234serverConfigs
public Builder serverConfigs(String serverConfigsStr)
设置该配置项。
Performs the server configs operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
serverConfigsStr | String | 服务端 Configs Str(类型 `String`)。The server configs str. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:236–239sandboxType
public Builder sandboxType(String sandboxType)
设置沙箱类型。
Performs the sandbox type operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxType | String | 沙箱类型(类型 `String`)。The sandbox type. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:241–244whitelist
public Builder whitelist(Set<String> whitelist)
设置该配置项。
Performs the whitelist operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
whitelist | Set<String> | whitelist(类型 `Set`)。The whitelist. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:246–249blacklist
public Builder blacklist(Set<String> blacklist)
设置该配置项。
Performs the blacklist operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
blacklist | Set<String> | blacklist(类型 `Set`)。The blacklist. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:251–254sandboxService
public Builder sandboxService(SandboxService sandboxService)
设置沙箱服务。
Performs the sandbox service operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxService | SandboxService | 沙箱服务(类型 `SandboxService`)。The sandbox service. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:256–259build
public McpConfigConverter build()
构建并返回最终实例。
Creates and returns an instance.
McpConfigConverter返回McpConfigConverter。Returns mcp config converter.
源码Source
io/agentscope/runtime/sandbox/tools/McpConfigConverter.java:261–263