SandboxTool
public abstract class SandboxTool extends Tool
io/agentscope/runtime/sandbox/tools/SandboxTool.java:24–69沙箱工具,封装可被智能体调用的能力。位于 io.agentscope.runtime.sandbox.tools 包,继承自 Tool。核心成员包括 getSandboxService、setSandboxService、getSandbox、setSandbox、getSchema、setSchema。
A class in io.agentscope.runtime.sandbox.tools that lets agents invoke external capabilities under control. Declared in io.agentscope.runtime.sandbox.tools. Extends Tool.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
sandboxService | SandboxService | 沙箱服务字段。 The sandbox service field. |
sandbox | Sandbox | 沙箱字段。 The sandbox field. |
schema | Map<String, Object> | 模式字段。 The schema field. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
protected SandboxTool(String name, String toolType, String description) | 初始化 `SandboxTool` 实例。 Creates a new instance. |
protected SandboxTool(String name, String toolType, String description, SandboxService sandboxService) | 初始化 `SandboxTool` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public SandboxService getSandboxService() | 获取沙箱服务。 Returns the sandbox service. |
public void setSandboxService(SandboxService sandboxService) | 设置沙箱服务。 Sets the sandbox service. |
public Sandbox getSandbox() | 获取沙箱。 Returns the sandbox. |
public void setSandbox(Sandbox sandbox) | 设置沙箱。 Sets the sandbox. |
public Map<String, Object> getSchema() | 获取模式。 Returns the schema. |
protected void setSchema(Map<String, Object> schema) | 设置模式。 Sets the schema. |
public abstract Class<? extends Sandbox> getSandboxClass()abstract | 获取沙箱类。 Returns the sandbox class. |
public abstract SandboxTool bind(Sandbox sandbox)abstract | 设置该参数。 Performs the bind operation. |
字段详情Field Detail
sandboxService
protected SandboxService sandboxService
沙箱服务字段。声明为 protected SandboxService sandboxService。
The sandbox service field.
io/agentscope/runtime/sandbox/tools/SandboxTool.java:26sandbox
protected Sandbox sandbox
沙箱字段。声明为 protected Sandbox sandbox。
The sandbox field.
io/agentscope/runtime/sandbox/tools/SandboxTool.java:28schema
protected Map<String, Object> schema
模式字段。声明为 protected Map schema。
The schema field.
io/agentscope/runtime/sandbox/tools/SandboxTool.java:30构造器详情Constructor Detail
SandboxTool
protected SandboxTool(String name, String toolType, String description)
初始化 SandboxTool 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
toolType | String | 工具类型(类型 `String`)。The tool type. |
description | String | 描述(类型 `String`)。The description. |
io/agentscope/runtime/sandbox/tools/SandboxTool.java:32–34SandboxTool
protected SandboxTool(String name, String toolType, String description, SandboxService sandboxService)
初始化 SandboxTool 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
toolType | String | 工具类型(类型 `String`)。The tool type. |
description | String | 描述(类型 `String`)。The description. |
sandboxService | SandboxService | 沙箱服务(类型 `SandboxService`)。The sandbox service. |
io/agentscope/runtime/sandbox/tools/SandboxTool.java:36–40方法详情Method Detail
getSandboxService
public SandboxService getSandboxService()
获取沙箱服务。
Returns the sandbox service.
SandboxServiceio/agentscope/runtime/sandbox/tools/SandboxTool.java:42–44setSandboxService
public void setSandboxService(SandboxService sandboxService)
设置沙箱服务。
Sets the sandbox service.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxService | SandboxService | 沙箱服务(类型 `SandboxService`)。The sandbox service. |
io/agentscope/runtime/sandbox/tools/SandboxTool.java:46–48getSandbox
public Sandbox getSandbox()
获取沙箱。
Returns the sandbox.
Sandboxio/agentscope/runtime/sandbox/tools/SandboxTool.java:50–52setSandbox
public void setSandbox(Sandbox sandbox)
设置沙箱。
Sets the sandbox.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandbox | Sandbox | 沙箱(类型 `Sandbox`)。The sandbox. |
io/agentscope/runtime/sandbox/tools/SandboxTool.java:54–56getSchema
public Map<String, Object> getSchema()
获取模式。
Returns the schema.
Map<String, Object>io/agentscope/runtime/sandbox/tools/SandboxTool.java:58–60setSchema
protected void setSchema(Map<String, Object> schema)
设置模式。
Sets the schema.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
schema | Map<String, Object> | 模式定义(类型 `Map`)。The schema. |
io/agentscope/runtime/sandbox/tools/SandboxTool.java:62–64getSandboxClass
public abstract Class<? extends Sandbox> getSandboxClass()
获取沙箱类。
Returns the sandbox class.
Class<? extends Sandbox>io/agentscope/runtime/sandbox/tools/SandboxTool.java:66bind
public abstract SandboxTool bind(Sandbox sandbox)
设置该参数。
Performs the bind operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandbox | Sandbox | 沙箱(类型 `Sandbox`)。The sandbox. |
SandboxToolio/agentscope/runtime/sandbox/tools/SandboxTool.java:68