AS AgentScopeAPI 手册 / API Reference

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.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:23

waitUntilHealthy

public abstract void waitUntilHealthy()
abstract

等待 waitUntilHealthy。

Returns the wait until healthy.

源码Source io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:25

callTool

public abstract String callTool(String toolName, Map<String, Object> arguments)
abstract

调用工具。

Calls the tool.

参数Parameters
名称Name类型Type说明Description
toolNameString工具名称(类型 `String`)。The tool name.
argumentsMap<String, Object>参数(类型 `Map`)。The arguments.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:27

listTools

public abstract Map<String, Object> listTools(String toolType, Map<String, Object> arguments)
abstract

列出工具。

Lists the tools.

参数Parameters
名称Name类型Type说明Description
toolTypeString工具类型(类型 `String`)。The tool type.
argumentsMap<String, Object>参数(类型 `Map`)。The arguments.
返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:29

addMcpServers

public abstract Map<String, Object> addMcpServers(Map<String, Object> serverConfigs, boolean overwrite)
abstract

添加 addMcpServers。

Adds the mcp servers.

参数Parameters
名称Name类型Type说明Description
serverConfigsMap<String, Object>服务端 Configs(类型 `Map`)。The server configs.
overwritebooleanoverwrite(类型 `boolean`)。The overwrite.
返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:31

close

public void close() throws Exception

关闭连接并释放相关资源。

Releases resources and connections.

抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/runtime/sandbox/manager/util/SandboxClient.java:33–36
基于官方固定版本源码静态生成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.