AS AgentScopeAPI 手册 / API Reference

Builder

public static final class Builder
源码Source io/agentscope/harness/agent/sandbox/SandboxContext.java:79–129

构建器,用于构建并配置目标实例。位于 io.agentscope.harness.agent.sandbox 包。核心成员包括 client、clientOptions、workspaceSpec、snapshotSpec、externalSandbox、externalSandboxState。

A class in io.agentscope.harness.agent.sandbox that deploys, schedules and serves agents. Declared in io.agentscope.harness.agent.sandbox.

方法摘要Method Summary

方法Method说明Description
public Builder client(SandboxClient<?> client)
设置客户端。
Performs the client operation.
public Builder clientOptions(SandboxClientOptions clientOptions)
设置客户端选项。
Performs the client options operation.
public Builder workspaceSpec(WorkspaceSpec workspaceSpec)
设置工作区规格。
Performs the workspace spec operation.
public Builder snapshotSpec(SandboxSnapshotSpec snapshotSpec)
设置快照规格。
Performs the snapshot spec operation.
public Builder externalSandbox(Sandbox externalSandbox)
设置外部沙箱。
Performs the external sandbox operation.
public Builder externalSandboxState(SandboxState externalSandboxState)
设置外部沙箱状态。
Performs the external sandbox state operation.
public Builder isolationScope(IsolationScope isolationScope)
执行隔离范围相关操作。
Performs the isolation scope operation.
public SandboxContext build()
构建并返回最终实例。
Creates and returns an instance.

方法详情Method Detail

client

public Builder client(SandboxClient<?> client)

设置客户端。

Performs the client operation.

参数Parameters
名称Name类型Type说明Description
clientSandboxClient<?>客户端(类型 `SandboxClient`)。The client.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/harness/agent/sandbox/SandboxContext.java:91–94

clientOptions

public Builder clientOptions(SandboxClientOptions clientOptions)

设置客户端选项。

Performs the client options operation.

参数Parameters
名称Name类型Type说明Description
clientOptionsSandboxClientOptions客户端选项(类型 `SandboxClientOptions`)。The client options.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/harness/agent/sandbox/SandboxContext.java:96–99

workspaceSpec

public Builder workspaceSpec(WorkspaceSpec workspaceSpec)

设置工作区规格。

Performs the workspace spec operation.

参数Parameters
名称Name类型Type说明Description
workspaceSpecWorkspaceSpec工作区规格(类型 `WorkspaceSpec`)。The workspace spec.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/harness/agent/sandbox/SandboxContext.java:101–104

snapshotSpec

public Builder snapshotSpec(SandboxSnapshotSpec snapshotSpec)

设置快照规格。

Performs the snapshot spec operation.

参数Parameters
名称Name类型Type说明Description
snapshotSpecSandboxSnapshotSpec快照规格(类型 `SandboxSnapshotSpec`)。The snapshot spec.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/harness/agent/sandbox/SandboxContext.java:106–109

externalSandbox

public Builder externalSandbox(Sandbox externalSandbox)

设置外部沙箱。

Performs the external sandbox operation.

参数Parameters
名称Name类型Type说明Description
externalSandboxSandbox外部沙箱(类型 `Sandbox`)。The external sandbox.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/harness/agent/sandbox/SandboxContext.java:111–114

externalSandboxState

public Builder externalSandboxState(SandboxState externalSandboxState)

设置外部沙箱状态。

Performs the external sandbox state operation.

参数Parameters
名称Name类型Type说明Description
externalSandboxStateSandboxState外部沙箱状态(类型 `SandboxState`)。The external sandbox state.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/harness/agent/sandbox/SandboxContext.java:116–119

isolationScope

public Builder isolationScope(IsolationScope isolationScope)

执行隔离范围相关操作。

Performs the isolation scope operation.

参数Parameters
名称Name类型Type说明Description
isolationScopeIsolationScope隔离范围(类型 `IsolationScope`)。The isolation scope.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/harness/agent/sandbox/SandboxContext.java:121–124

build

public SandboxContext build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns SandboxContext
返回SandboxContext。Returns sandbox context.
源码Source io/agentscope/harness/agent/sandbox/SandboxContext.java:126–128
基于官方固定版本源码静态生成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.