AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:111–166

SandboxConfig的构建器。位于 io.agentscope.runtime.sandbox.manager.model.container 包。核心成员包括 imageName、sandboxType、resourceLimits、securityLevel、timeout、description。

Builder for SandboxConfig

方法摘要Method Summary

方法Method说明Description
public Builder imageName(String imageName)
设置图像名称。
Performs the image name operation.
public Builder sandboxType(SandboxType sandboxType)
设置沙箱类型。
Performs the sandbox type operation.
public Builder resourceLimits(Map<String, Object> resourceLimits)
设置该配置项。
Performs the resource limits operation.
public Builder securityLevel(String securityLevel)
设置该配置项。
Performs the security level operation.
public Builder timeout(int timeout)
设置超时。
Performs the timeout operation.
public Builder description(String description)
设置该配置项。
Performs the description operation.
public Builder environment(Map<String, String> environment)
设置环境。
Performs the environment operation.
public Builder runtimeConfig(Map<String, Object> runtimeConfig)
设置运行时配置。
Performs the runtime config operation.
public SandboxConfig build()
构建并返回最终实例。
Creates and returns an instance.

方法详情Method Detail

imageName

public Builder imageName(String imageName)

设置图像名称。

Performs the image name operation.

参数Parameters
名称Name类型Type说明Description
imageNameString图像名称(类型 `String`)。The image name.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:121–124

sandboxType

public Builder sandboxType(SandboxType sandboxType)

设置沙箱类型。

Performs the sandbox type operation.

参数Parameters
名称Name类型Type说明Description
sandboxTypeSandboxType沙箱类型(类型 `SandboxType`)。The sandbox type.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:126–129

resourceLimits

public Builder resourceLimits(Map<String, Object> resourceLimits)

设置该配置项。

Performs the resource limits operation.

参数Parameters
名称Name类型Type说明Description
resourceLimitsMap<String, Object>资源 Limits(类型 `Map`)。The resource limits.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:131–134

securityLevel

public Builder securityLevel(String securityLevel)

设置该配置项。

Performs the security level operation.

参数Parameters
名称Name类型Type说明Description
securityLevelStringsecurity 级别(类型 `String`)。The security level.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:136–139

timeout

public Builder timeout(int timeout)

设置超时。

Performs the timeout operation.

参数Parameters
名称Name类型Type说明Description
timeoutint超时时间(类型 `int`)。The timeout.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:141–144

description

public Builder description(String description)

设置该配置项。

Performs the description operation.

参数Parameters
名称Name类型Type说明Description
descriptionString描述(类型 `String`)。The description.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:146–149

environment

public Builder environment(Map<String, String> environment)

设置环境。

Performs the environment operation.

参数Parameters
名称Name类型Type说明Description
environmentMap<String, String>环境(类型 `Map`)。The environment.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:151–154

runtimeConfig

public Builder runtimeConfig(Map<String, Object> runtimeConfig)

设置运行时配置。

Performs the runtime config operation.

参数Parameters
名称Name类型Type说明Description
runtimeConfigMap<String, Object>运行时配置(类型 `Map`)。The runtime config.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:156–159

build

public SandboxConfig build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns SandboxConfig
返回SandboxConfig。Returns sandbox config.
源码Source io/agentscope/runtime/sandbox/manager/model/container/SandboxConfig.java:161–165
基于官方固定版本源码静态生成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.