AS AgentScopeAPI 手册 / API Reference

RedisSandboxMap

public class RedisSandboxMap implements SandboxMap
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:31–221

Redis 沙箱映射,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.sandbox.map 包,实现 SandboxMap。核心成员包括 addSandbox、getSandbox、removeSandbox、containSandbox、getAllSandboxes、RedisSandboxMap。

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

构造器摘要Constructor Summary

构造器Constructor说明Description
public RedisSandboxMap(RedisManagerConfig redisManagerConfig)
初始化 `RedisSandboxMap` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public void addSandbox(SandboxKey sandboxKey, ContainerModel containerModel)
添加沙箱。
Adds the sandbox.
public ContainerModel getSandbox(SandboxKey sandboxKey)
获取沙箱。
Returns the sandbox.
public ContainerModel getSandbox(String containerId)
获取沙箱。
Returns the sandbox.
public boolean removeSandbox(SandboxKey sandboxKey)
移除沙箱。
Removes the sandbox.
public void removeSandbox(String containerId)
移除沙箱。
Removes the sandbox.
public boolean containSandbox(SandboxKey sandboxKey)
设置该参数。
Performs the contain sandbox operation.
public boolean containSandbox(String containerId)
设置该参数。
Performs the contain sandbox operation.
public Map<String, ContainerModel> getAllSandboxes()
获取 `getAllSandboxes`。
Returns the all sandboxes.

构造器详情Constructor Detail

RedisSandboxMap

public RedisSandboxMap(RedisManagerConfig redisManagerConfig)

初始化 RedisSandboxMap 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
redisManagerConfigRedisManagerConfigRedis 管理器配置(类型 `RedisManagerConfig`)。The redis manager config.
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:43–53

方法详情Method Detail

addSandbox

public void addSandbox(SandboxKey sandboxKey, ContainerModel containerModel)

添加沙箱。

Adds the sandbox.

参数Parameters
名称Name类型Type说明Description
sandboxKeySandboxKey沙箱键(类型 `SandboxKey`)。The sandbox key.
containerModelContainerModel容器模型(类型 `ContainerModel`)。The container model.
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:67–97

getSandbox

public ContainerModel getSandbox(SandboxKey sandboxKey)

获取沙箱。

Returns the sandbox.

参数Parameters
名称Name类型Type说明Description
sandboxKeySandboxKey沙箱键(类型 `SandboxKey`)。The sandbox key.
返回Returns ContainerModel
返回ContainerModel。Returns container model.
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:99–120

getSandbox

public ContainerModel getSandbox(String containerId)

获取沙箱。

Returns the sandbox.

参数Parameters
名称Name类型Type说明Description
containerIdString容器标识(类型 `String`)。The container id.
返回Returns ContainerModel
返回ContainerModel。Returns container model.
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:122–138

removeSandbox

public boolean removeSandbox(SandboxKey sandboxKey)

移除沙箱。

Removes the sandbox.

参数Parameters
名称Name类型Type说明Description
sandboxKeySandboxKey沙箱键(类型 `SandboxKey`)。The sandbox key.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:140–156

removeSandbox

public void removeSandbox(String containerId)

移除沙箱。

Removes the sandbox.

参数Parameters
名称Name类型Type说明Description
containerIdString容器标识(类型 `String`)。The container id.
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:158–178

containSandbox

public boolean containSandbox(SandboxKey sandboxKey)

设置该参数。

Performs the contain sandbox operation.

参数Parameters
名称Name类型Type说明Description
sandboxKeySandboxKey沙箱键(类型 `SandboxKey`)。The sandbox key.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:180–189

containSandbox

public boolean containSandbox(String containerId)

设置该参数。

Performs the contain sandbox operation.

参数Parameters
名称Name类型Type说明Description
containerIdString容器标识(类型 `String`)。The container id.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:191–195

getAllSandboxes

public Map<String, ContainerModel> getAllSandboxes()

获取 getAllSandboxes。

Returns the all sandboxes.

返回Returns Map<String, ContainerModel>
返回映射。Returns map.
源码Source io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:197–220
基于官方固定版本源码静态生成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.