AS AgentScopeAPI 手册 / API Reference

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
targetClassClass<?>类到注册。The class to register
configSandboxConfig沙箱配置。The sandbox configuration
源码Source io/agentscope/runtime/sandbox/manager/registry/SandboxRegistryService.java:48–61

getConfigByType

public static Optional<SandboxConfig> getConfigByType(String sandboxType)
static

获取沙箱配置通过类型。

Get sandbox configuration by type

参数Parameters
名称Name类型Type说明Description
sandboxTypeString沙箱类型。The sandbox type
返回Returns Optional<SandboxConfig>
返回可选。Optional containing the configuration if found
源码Source io/agentscope/runtime/sandbox/manager/registry/SandboxRegistryService.java:70–72

getImageByType

public static Optional<String> getImageByType(String sandboxType)
static

获取图像通过类型。

Get Docker image name by sandbox type

参数Parameters
名称Name类型Type说明Description
sandboxTypeString沙箱类型。The sandbox type
返回Returns Optional<String>
返回可选。Optional containing the image name if found
源码Source io/agentscope/runtime/sandbox/manager/registry/SandboxRegistryService.java:80–82
基于官方固定版本源码静态生成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.