AS AgentScopeAPI 手册 / API Reference

E2bFilesystemSpec

public class E2bFilesystemSpec extends SandboxFilesystemSpec
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:26–138

E 2 b 文件系统规格,在隔离环境中安全执行代码和工具。位于 io.agentscope.extensions.sandbox.e2b 包,继承自 SandboxFilesystemSpec。核心成员包括 client、apiKey、apiBaseUrl、domain、templateId、workspaceRoot。

SandboxFilesystemSpec for E2B cloud sandboxes.

方法摘要Method Summary

方法Method说明Description
public E2bFilesystemSpec client(SandboxClient<?> client)
设置客户端。
Performs the client operation.
public E2bFilesystemSpec apiKey(String apiKey)
设置API 键。
Performs the api key operation.
public E2bFilesystemSpec apiBaseUrl(String apiBaseUrl)
设置API 基类 URL。
Performs the api base url operation.
public E2bFilesystemSpec domain(String domain)
设置该参数。
Performs the domain operation.
public E2bFilesystemSpec templateId(String templateId)
设置模板标识。
Performs the template id operation.
public E2bFilesystemSpec workspaceRoot(String workspaceRoot)
设置工作区根。
Performs the workspace root operation.
public E2bFilesystemSpec sandboxTimeoutSeconds(int sandboxTimeoutSeconds)
设置沙箱超时秒。
Performs the sandbox timeout seconds operation.
public E2bFilesystemSpec runUser(String runUser)
运行用户。
Runs the user.
public E2bFilesystemSpec persistenceMode(E2bPersistenceMode persistenceMode)
设置持久化模式。
Performs the persistence mode operation.
public E2bFilesystemSpec codec(E2bCodec codec)
设置编解码器。
Performs the codec operation.
public E2bFilesystemSpec connectTimeoutSeconds(int connectTimeoutSeconds)
设置连接超时秒。
Performs the connect timeout seconds operation.
public E2bFilesystemSpec readTimeoutSeconds(int readTimeoutSeconds)
设置读取超时秒。
Performs the read timeout seconds operation.
public E2bFilesystemSpec maxRetries(int maxRetries)
设置最大重试。
Performs the max retries operation.
public E2bFilesystemSpec snapshotRetention(int snapshotRetention)
设置该参数。
Maximum number of snapshots created by this session that are kept on shutdown; `<= 0` disables pruning.
public E2bFilesystemSpec snapshotSpec(SandboxSnapshotSpec snapshotSpec)
设置快照规格。
Performs the snapshot spec operation.
public E2bFilesystemSpec workspaceSpec(WorkspaceSpec workspaceSpec)
设置工作区规格。
Performs the workspace spec operation.
protected SandboxClient<?> createClient()
创建客户端。
Creates the client.
protected SandboxClientOptions clientOptions()
返回客户端选项。
Returns the client options.
protected SandboxSnapshotSpec snapshotSpec()
返回快照规格。
Returns the snapshot spec.
protected WorkspaceSpec workspaceSpec()
返回工作区规格。
Returns the workspace spec.

方法详情Method Detail

client

public E2bFilesystemSpec client(SandboxClient<?> client)

设置客户端。

Performs the client operation.

参数Parameters
名称Name类型Type说明Description
clientSandboxClient<?>客户端(类型 `SandboxClient`)。The client.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:33–36

apiKey

public E2bFilesystemSpec apiKey(String apiKey)

设置API 键。

Performs the api key operation.

参数Parameters
名称Name类型Type说明Description
apiKeyStringAPI 键(类型 `String`)。The api key.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:38–41

apiBaseUrl

public E2bFilesystemSpec apiBaseUrl(String apiBaseUrl)

设置API 基类 URL。

Performs the api base url operation.

参数Parameters
名称Name类型Type说明Description
apiBaseUrlStringAPI 基类 URL(类型 `String`)。The api base url.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:43–46

domain

public E2bFilesystemSpec domain(String domain)

设置该参数。

Performs the domain operation.

参数Parameters
名称Name类型Type说明Description
domainStringdomain(类型 `String`)。The domain.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:48–51

templateId

public E2bFilesystemSpec templateId(String templateId)

设置模板标识。

Performs the template id operation.

参数Parameters
名称Name类型Type说明Description
templateIdString模板标识(类型 `String`)。The template id.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:53–56

workspaceRoot

public E2bFilesystemSpec workspaceRoot(String workspaceRoot)

设置工作区根。

Performs the workspace root operation.

参数Parameters
名称Name类型Type说明Description
workspaceRootString工作区根(类型 `String`)。The workspace root.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:58–61

sandboxTimeoutSeconds

public E2bFilesystemSpec sandboxTimeoutSeconds(int sandboxTimeoutSeconds)

设置沙箱超时秒。

Performs the sandbox timeout seconds operation.

参数Parameters
名称Name类型Type说明Description
sandboxTimeoutSecondsint沙箱超时秒(类型 `int`)。The sandbox timeout seconds.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:63–66

runUser

public E2bFilesystemSpec runUser(String runUser)

运行用户。

Runs the user.

参数Parameters
名称Name类型Type说明Description
runUserString运行用户(类型 `String`)。The run user.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:68–71

persistenceMode

public E2bFilesystemSpec persistenceMode(E2bPersistenceMode persistenceMode)

设置持久化模式。

Performs the persistence mode operation.

参数Parameters
名称Name类型Type说明Description
persistenceModeE2bPersistenceMode持久化模式(类型 `E2bPersistenceMode`)。The persistence mode.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:73–76

codec

public E2bFilesystemSpec codec(E2bCodec codec)

设置编解码器。

Performs the codec operation.

参数Parameters
名称Name类型Type说明Description
codecE2bCodec编解码器(类型 `E2bCodec`)。The codec.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:78–81

connectTimeoutSeconds

public E2bFilesystemSpec connectTimeoutSeconds(int connectTimeoutSeconds)

设置连接超时秒。

Performs the connect timeout seconds operation.

参数Parameters
名称Name类型Type说明Description
connectTimeoutSecondsint连接超时秒(类型 `int`)。The connect timeout seconds.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:83–86

readTimeoutSeconds

public E2bFilesystemSpec readTimeoutSeconds(int readTimeoutSeconds)

设置读取超时秒。

Performs the read timeout seconds operation.

参数Parameters
名称Name类型Type说明Description
readTimeoutSecondsint读取超时秒(类型 `int`)。The read timeout seconds.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:88–91

maxRetries

public E2bFilesystemSpec maxRetries(int maxRetries)

设置最大重试。

Performs the max retries operation.

参数Parameters
名称Name类型Type说明Description
maxRetriesint最大重试(类型 `int`)。The max retries.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:93–96

snapshotRetention

public E2bFilesystemSpec snapshotRetention(int snapshotRetention)

设置该参数。

Maximum number of snapshots created by this session that are kept on shutdown; <= 0 disables pruning.

参数Parameters
名称Name类型Type说明Description
snapshotRetentionint快照 Retention(类型 `int`)。The snapshot retention.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:104–107

snapshotSpec

public E2bFilesystemSpec snapshotSpec(SandboxSnapshotSpec snapshotSpec)

设置快照规格。

Performs the snapshot spec operation.

参数Parameters
名称Name类型Type说明Description
snapshotSpecSandboxSnapshotSpec快照规格(类型 `SandboxSnapshotSpec`)。The snapshot spec.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:109–112

workspaceSpec

public E2bFilesystemSpec workspaceSpec(WorkspaceSpec workspaceSpec)

设置工作区规格。

Performs the workspace spec operation.

参数Parameters
名称Name类型Type说明Description
workspaceSpecWorkspaceSpec工作区规格(类型 `WorkspaceSpec`)。The workspace spec.
返回Returns E2bFilesystemSpec
返回E2bFilesystemSpec。Returns e 2 b filesystem spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:114–117

createClient

protected SandboxClient<?> createClient()

创建客户端。

Creates the client.

返回Returns SandboxClient<?>
返回SandboxClient。Returns sandbox client.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:119–122

clientOptions

protected SandboxClientOptions clientOptions()

返回客户端选项。

Returns the client options.

返回Returns SandboxClientOptions
返回SandboxClientOptions。Returns sandbox client options.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:124–127

snapshotSpec

protected SandboxSnapshotSpec snapshotSpec()

返回快照规格。

Returns the snapshot spec.

返回Returns SandboxSnapshotSpec
返回SandboxSnapshotSpec。Returns sandbox snapshot spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:129–132

workspaceSpec

protected WorkspaceSpec workspaceSpec()

返回工作区规格。

Returns the workspace spec.

返回Returns WorkspaceSpec
返回WorkspaceSpec。Returns workspace spec.
源码Source io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:134–137

继承成员Inherited Members

基于官方固定版本源码静态生成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.