AS AgentScopeAPI 手册 / API Reference

SandboxIsolationKey

public final class SandboxIsolationKey
源码Source io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:33–140

沙箱隔离键,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.sandbox 包。核心成员包括 resolve、getScope、getValue、equals、hashCode、toString。

Immutable key that uniquely identifies a sandbox state slot for a given IsolationScope.

Use #resolve to obtain a key from a RuntimeContext. The result is Optional#empty() when the required context field is absent (e.g., USER scope without a userId), meaning state lookup should be skipped.

方法摘要Method Summary

方法Method说明Description
public static Optional<SandboxIsolationKey> resolve(IsolationScope scope, RuntimeContext ctx, String agentId)
static
执行解析相关操作。
Resolves an isolation key from the given scope, runtime context, and agent ID.
public IsolationScope getScope()
返回隔离范围。
Returns the isolation scope.
public String getValue()
获取值。
Returns the discriminating value within the scope (e.g.
public boolean equals(Object o)
设置该参数。
Performs the equals operation.
public int hashCode()
返回 `hashCode` 结果。
Returns the hash code.
public String toString()
返回 `toString` 结果。
Returns the to string.

方法详情Method Detail

resolve

public static Optional<SandboxIsolationKey> resolve(IsolationScope scope, RuntimeContext ctx, String agentId)
static

执行解析相关操作。

Resolves an isolation key from the given scope, runtime context, and agent ID.

参数Parameters
名称Name类型Type说明Description
scopeIsolationScope范围(类型 `IsolationScope`)。the desired isolation scope; `null` defaults to `USER`
ctxRuntimeContext运行时上下文用于当前调用;可能为`null`。the runtime context for the current call; may be `null`
agentIdString智能体标识(类型 `String`)。the agent name resolved at build time; must not be null
返回Returns Optional<SandboxIsolationKey>
返回可选。resolved key, or empty if the required context field is absent
源码Source io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:67–104

getScope

public IsolationScope getScope()

返回隔离范围。

Returns the isolation scope.

返回Returns IsolationScope
返回IsolationScope。scope
源码Source io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:111–113

getValue

public String getValue()

获取值。

Returns the discriminating value within the scope (e.g.

返回Returns String
返回字符串结果。value string
源码Source io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:120–122

equals

public boolean equals(Object o)

设置该参数。

Performs the equals operation.

参数Parameters
名称Name类型Type说明Description
oObjecto(类型 `Object`)。The o.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:124–129

hashCode

public int hashCode()

返回 hashCode 结果。

Returns the hash code.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:131–134

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/sandbox/SandboxIsolationKey.java:136–139
基于官方固定版本源码静态生成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.