AS AgentScopeAPI 手册 / API Reference

E2bSnapshotRefs

public final class E2bSnapshotRefs
源码Source io/agentscope/extensions/sandbox/e2b/E2bSnapshotRefs.java:26–69

E 2 b 快照 Refs,在隔离环境中安全执行代码和工具。位于 io.agentscope.extensions.sandbox.e2b 包。核心成员包括 encodeSnapshotId、decodeSnapshotIdIfPresent、MAGIC_PREFIX。

Cross-language marker for E2B native snapshot references, aligned with openai-agents-python E2B_SANDBOX_SNAPSHOT_V1.

字段摘要Field Summary

字段Field类型Type说明Description
MAGIC_PREFIX
staticfinal
byte[]
MAGIC PREFIX字段。
The MAGIC PREFIX field.

方法摘要Method Summary

方法Method说明Description
public static byte[] encodeSnapshotId(String snapshotId) throws Exception
static
执行快照标识。
Performs the encode snapshot id operation.
public static String decodeSnapshotIdIfPresent(byte[] raw)
static
执行 `decodeSnapshotIdIfPresent`。
Performs the decode snapshot id if present operation.

字段详情Field Detail

MAGIC_PREFIX

public static final byte[] MAGIC_PREFIX
staticfinal

MAGIC PREFIX字段。声明为 public static final byte[] MAGIC_PREFIX。

The MAGIC PREFIX field.

源码Source io/agentscope/extensions/sandbox/e2b/E2bSnapshotRefs.java:28–29

方法详情Method Detail

encodeSnapshotId

public static byte[] encodeSnapshotId(String snapshotId) throws Exception
static

执行快照标识。

Performs the encode snapshot id operation.

参数Parameters
名称Name类型Type说明Description
snapshotIdString快照标识(类型 `String`)。The snapshot id.
返回Returns byte[]
返回byte[]。Returns byte.
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/extensions/sandbox/e2b/E2bSnapshotRefs.java:33–41

decodeSnapshotIdIfPresent

public static String decodeSnapshotIdIfPresent(byte[] raw)
static

执行 decodeSnapshotIdIfPresent。

Performs the decode snapshot id if present operation.

参数Parameters
名称Name类型Type说明Description
rawbyte[]原始(类型 `byte[]`)。The raw.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/e2b/E2bSnapshotRefs.java:43–68
基于官方固定版本源码静态生成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.