AS AgentScopeAPI 手册 / API Reference

RemoteSnapshotClient

public interface RemoteSnapshotClient
源码Source io/agentscope/harness/agent/sandbox/snapshot/RemoteSnapshotClient.java:28–56

定义远程快照客户端契约的接口。位于 io.agentscope.harness.agent.sandbox.snapshot 包。核心成员包括 upload、download、exists。

User-implemented interface for uploading and downloading snapshot archives to/from remote storage (e.g. S3, OSS, GCS, or a custom blob store).

Implement this interface and pass it to RemoteSnapshotSpec to enable remote snapshot storage. The implementation is responsible for authentication, retry logic, and connection management.

方法摘要Method Summary

方法Method说明Description
public void upload(String snapshotId, InputStream data) throws Exception
执行上传相关操作。
Uploads a snapshot archive to remote storage.
public InputStream download(String snapshotId) throws Exception
设置下载。
Downloads a snapshot archive from remote storage.
public boolean exists(String snapshotId) throws Exception
判断数据是否存在。
Checks whether a snapshot with the given ID exists in remote storage.

方法详情Method Detail

upload

public void upload(String snapshotId, InputStream data) throws Exception

执行上传相关操作。

Uploads a snapshot archive to remote storage.

参数Parameters
名称Name类型Type说明Description
snapshotIdString快照标识(类型 `String`)。unique identifier for this snapshot
dataInputStream数据(类型 `InputStream`)。the workspace tar archive stream to upload
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/agent/sandbox/snapshot/RemoteSnapshotClient.java:37

download

public InputStream download(String snapshotId) throws Exception

设置下载。

Downloads a snapshot archive from remote storage.

参数Parameters
名称Name类型Type说明Description
snapshotIdString快照标识(类型 `String`)。unique identifier for the snapshot to download
返回Returns InputStream
返回InputStream。an `InputStream` over the downloaded tar archive
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/agent/sandbox/snapshot/RemoteSnapshotClient.java:46

exists

public boolean exists(String snapshotId) throws Exception

判断数据是否存在。

Checks whether a snapshot with the given ID exists in remote storage.

参数Parameters
名称Name类型Type说明Description
snapshotIdString快照标识(类型 `String`)。unique identifier to check
返回Returns boolean
返回布尔值,表示判断结果。`true` if the snapshot exists and can be downloaded
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/harness/agent/sandbox/snapshot/RemoteSnapshotClient.java:55
基于官方固定版本源码静态生成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.