DummySandbox
public class DummySandbox implements AutoCloseable
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:25–106Dummy 沙箱,承载智能体的部署、调度与服务化运行。位于 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 |
|---|---|---|
managerApi | SandboxManager | 管理器 API(类型 `SandboxManager`)。The manager api. |
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:34–36DummySandbox
public DummySandbox(SandboxManager managerApi, String userId, String sessionId, int timeout)
初始化 DummySandbox 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
managerApi | SandboxManager | 管理器 API(类型 `SandboxManager`)。The manager api. |
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
timeout | int | 超时时间(类型 `int`)。The timeout. |
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:38–52方法详情Method Detail
getSandboxId
public String getSandboxId()
获取沙箱标识。
Returns the sandbox id.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:54–56getUserId
public String getUserId()
获取用户标识。
Returns the user id.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:58–60getSessionId
public String getSessionId()
获取会话标识。
Returns the session id.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:62–64getSandboxType
public SandboxType getSandboxType()
获取沙箱类型。
Returns the sandbox type.
SandboxType返回SandboxType。Returns sandbox type.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:66–68getInfo
public ContainerModel getInfo()
获取信息。
Returns the info.
ContainerModel返回ContainerModel。Returns container model.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:70–76listTools
public Map<String, Object> listTools(String toolType)
列出工具。
Lists the tools.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolType | String | 工具类型(类型 `String`)。The tool type. |
Map<String, Object>返回映射。Returns map.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:78–81callTool
public String callTool(String name, Map<String, Object> arguments)
调用工具。
Calls the tool.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
arguments | Map<String, Object> | 参数(类型 `Map`)。The arguments. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:83–87close
public void close()
关闭连接并释放相关资源。
Releases resources and connections.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:89–96release
public void release()
关闭资源并释放连接。
Releases resources and connections.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:98–101isClosed
public boolean isClosed()
判断是否已关闭。
Returns whether the closed.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/box/DummySandbox.java:103–105