SandboxClient
public abstract class SandboxClient implements AutoCloseable
源码Source
io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:21–37沙箱客户端,封装与远端服务的连接和调用。位于 io.agentscope.runtime.sandbox.manager.util 包,实现 AutoCloseable。核心成员包括 checkHealth、waitUntilHealthy、callTool、listTools、addMcpServers、close。
A class in io.agentscope.runtime.sandbox.manager.util that deploys, schedules and serves agents. Declared in io.agentscope.runtime.sandbox.manager.util. Implements AutoCloseable.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public abstract boolean checkHealth()abstract | 检查健康状态。 Returns the check health. |
public abstract void waitUntilHealthy()abstract | 等待 `waitUntilHealthy`。 Returns the wait until healthy. |
public abstract String callTool(String toolName, Map<String, Object> arguments)abstract | 调用工具。 Calls the tool. |
public abstract Map<String, Object> listTools(String toolType, Map<String, Object> arguments)abstract | 列出工具。 Lists the tools. |
public abstract Map<String, Object> addMcpServers(Map<String, Object> serverConfigs, boolean overwrite)abstract | 添加 `addMcpServers`。 Adds the mcp servers. |
public void close() throws Exception | 关闭连接并释放相关资源。 Releases resources and connections. |
方法详情Method Detail
checkHealth
public abstract boolean checkHealth()
abstract
检查健康状态。
Returns the check health.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:23waitUntilHealthy
public abstract void waitUntilHealthy()
abstract
等待 waitUntilHealthy。
Returns the wait until healthy.
源码Source
io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:25callTool
public abstract String callTool(String toolName, Map<String, Object> arguments)
abstract
调用工具。
Calls the tool.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolName | String | 工具名称(类型 `String`)。The tool name. |
arguments | Map<String, Object> | 参数(类型 `Map`)。The arguments. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:27listTools
public abstract Map<String, Object> listTools(String toolType, Map<String, Object> arguments)
abstract
列出工具。
Lists the tools.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolType | String | 工具类型(类型 `String`)。The tool type. |
arguments | Map<String, Object> | 参数(类型 `Map`)。The arguments. |
Map<String, Object>返回映射。Returns map.
源码Source
io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:29addMcpServers
public abstract Map<String, Object> addMcpServers(Map<String, Object> serverConfigs, boolean overwrite)
abstract
添加 addMcpServers。
Adds the mcp servers.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
serverConfigs | Map<String, Object> | 服务端 Configs(类型 `Map`)。The server configs. |
overwrite | boolean | overwrite(类型 `boolean`)。The overwrite. |
Map<String, Object>返回映射。Returns map.
源码Source
io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:31close
public void close() throws Exception
关闭连接并释放相关资源。
Releases resources and connections.
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:33–36