AS AgentScopeAPI 手册 / API Reference

DummySandbox

public class DummySandbox implements AutoCloseable
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:25–106

Dummy 沙箱,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.sandbox.box 包,实现 AutoCloseable。核心成员包括 getSandboxId、getUserId、getSessionId、getSandboxType、getInfo、listTools。

A class in io.agentscope.runtime.sandbox.box that deploys, schedules and serves agents. Declared in io.agentscope.runtime.sandbox.box. Implements AutoCloseable.

构造器摘要Constructor Summary

构造器Constructor说明Description
public DummySandbox(SandboxManager managerApi, String userId, String sessionId)
初始化 `DummySandbox` 实例。
Creates a new instance.
public DummySandbox(SandboxManager managerApi, String userId, String sessionId, int timeout)
初始化 `DummySandbox` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getSandboxId()
获取沙箱标识。
Returns the sandbox id.
public String getUserId()
获取用户标识。
Returns the user id.
public String getSessionId()
获取会话标识。
Returns the session id.
public SandboxType getSandboxType()
获取沙箱类型。
Returns the sandbox type.
public ContainerModel getInfo()
获取信息。
Returns the info.
public Map<String, Object> listTools(String toolType)
列出工具。
Lists the tools.
public String callTool(String name, Map<String, Object> arguments)
调用工具。
Calls the tool.
public void close()
关闭连接并释放相关资源。
Releases resources and connections.
public void release()
关闭资源并释放连接。
Releases resources and connections.
public boolean isClosed()
判断是否已关闭。
Returns whether the closed.

构造器详情Constructor Detail

DummySandbox

public DummySandbox(SandboxManager managerApi, String userId, String sessionId)

初始化 DummySandbox 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
managerApiSandboxManager管理器 API(类型 `SandboxManager`)。The manager api.
userIdString用户标识(类型 `String`)。The user id.
sessionIdString会话标识(类型 `String`)。The session id.
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:34–36

DummySandbox

public DummySandbox(SandboxManager managerApi, String userId, String sessionId, int timeout)

初始化 DummySandbox 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
managerApiSandboxManager管理器 API(类型 `SandboxManager`)。The manager api.
userIdString用户标识(类型 `String`)。The user id.
sessionIdString会话标识(类型 `String`)。The session id.
timeoutint超时时间(类型 `int`)。The timeout.
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:38–52

方法详情Method Detail

getSandboxId

public String getSandboxId()

获取沙箱标识。

Returns the sandbox id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:54–56

getUserId

public String getUserId()

获取用户标识。

Returns the user id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:58–60

getSessionId

public String getSessionId()

获取会话标识。

Returns the session id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:62–64

getSandboxType

public SandboxType getSandboxType()

获取沙箱类型。

Returns the sandbox type.

返回Returns SandboxType
返回SandboxType。Returns sandbox type.
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:66–68

getInfo

public ContainerModel getInfo()

获取信息。

Returns the info.

返回Returns ContainerModel
返回ContainerModel。Returns container model.
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:70–76

listTools

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

列出工具。

Lists the tools.

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

callTool

public String callTool(String name, Map<String, Object> arguments)

调用工具。

Calls the tool.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
argumentsMap<String, Object>参数(类型 `Map`)。The arguments.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:83–87

close

public void close()

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

Releases resources and connections.

源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:89–96

release

public void release()

关闭资源并释放连接。

Releases resources and connections.

源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:98–101

isClosed

public boolean isClosed()

判断是否已关闭。

Returns whether the closed.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/sandbox/box/DummySandbox.java:103–105
基于官方固定版本源码静态生成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.