SandboxRegistryService
public class SandboxRegistryService
源码Source
io/agentscope/runtime/sandbox/manager/registry/SandboxRegistryService.java:29–83沙箱注册表服务,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.sandbox.manager.registry 包。核心成员包括 register、getConfigByType、getImageByType。
Sandbox registry for managing sandbox configurations
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static void register(Class<?> targetClass, SandboxConfig config)static | 用于特定类和类型的注册沙箱配置。 Register a sandbox configuration for a specific class and type |
public static Optional<SandboxConfig> getConfigByType(String sandboxType)static | 获取沙箱配置通过类型。 Get sandbox configuration by type |
public static Optional<String> getImageByType(String sandboxType)static | 获取图像通过类型。 Get Docker image name by sandbox type |
方法详情Method Detail
register
public static void register(Class<?> targetClass, SandboxConfig config)
static
用于特定类和类型的注册沙箱配置。
Register a sandbox configuration for a specific class and type
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
targetClass | Class<?> | 类到注册。The class to register |
config | SandboxConfig | 沙箱配置。The sandbox configuration |
源码Source
io/agentscope/runtime/sandbox/manager/registry/SandboxRegistryService.java:48–61getConfigByType
public static Optional<SandboxConfig> getConfigByType(String sandboxType)
static
获取沙箱配置通过类型。
Get sandbox configuration by type
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxType | String | 沙箱类型。The sandbox type |
Optional<SandboxConfig>返回可选。Optional containing the configuration if found
源码Source
io/agentscope/runtime/sandbox/manager/registry/SandboxRegistryService.java:70–72getImageByType
public static Optional<String> getImageByType(String sandboxType)
static
获取图像通过类型。
Get Docker image name by sandbox type
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxType | String | 沙箱类型。The sandbox type |
Optional<String>返回可选。Optional containing the image name if found
源码Source
io/agentscope/runtime/sandbox/manager/registry/SandboxRegistryService.java:80–82