E2bFilesystemSpec
public class E2bFilesystemSpec extends SandboxFilesystemSpec
io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:26–138E 2 b 文件系统规格,在隔离环境中安全执行代码和工具。位于 io.agentscope.extensions.sandbox.e2b 包,继承自 SandboxFilesystemSpec。核心成员包括 client、apiKey、apiBaseUrl、domain、templateId、workspaceRoot。
SandboxFilesystemSpec for E2B cloud sandboxes.
方法摘要Method Summary
方法详情Method Detail
client
public E2bFilesystemSpec client(SandboxClient<?> client)
设置客户端。
Performs the client operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
client | SandboxClient<?> | 客户端(类型 `SandboxClient`)。The client. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:33–36apiKey
public E2bFilesystemSpec apiKey(String apiKey)
设置API 键。
Performs the api key operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiKey | String | API 键(类型 `String`)。The api key. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:38–41apiBaseUrl
public E2bFilesystemSpec apiBaseUrl(String apiBaseUrl)
设置API 基类 URL。
Performs the api base url operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiBaseUrl | String | API 基类 URL(类型 `String`)。The api base url. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:43–46domain
public E2bFilesystemSpec domain(String domain)
设置该参数。
Performs the domain operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
domain | String | domain(类型 `String`)。The domain. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:48–51templateId
public E2bFilesystemSpec templateId(String templateId)
设置模板标识。
Performs the template id operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
templateId | String | 模板标识(类型 `String`)。The template id. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:53–56workspaceRoot
public E2bFilesystemSpec workspaceRoot(String workspaceRoot)
设置工作区根。
Performs the workspace root operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceRoot | String | 工作区根(类型 `String`)。The workspace root. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:58–61sandboxTimeoutSeconds
public E2bFilesystemSpec sandboxTimeoutSeconds(int sandboxTimeoutSeconds)
设置沙箱超时秒。
Performs the sandbox timeout seconds operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxTimeoutSeconds | int | 沙箱超时秒(类型 `int`)。The sandbox timeout seconds. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:63–66runUser
public E2bFilesystemSpec runUser(String runUser)
运行用户。
Runs the user.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runUser | String | 运行用户(类型 `String`)。The run user. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:68–71persistenceMode
public E2bFilesystemSpec persistenceMode(E2bPersistenceMode persistenceMode)
设置持久化模式。
Performs the persistence mode operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
persistenceMode | E2bPersistenceMode | 持久化模式(类型 `E2bPersistenceMode`)。The persistence mode. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:73–76codec
public E2bFilesystemSpec codec(E2bCodec codec)
设置编解码器。
Performs the codec operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
codec | E2bCodec | 编解码器(类型 `E2bCodec`)。The codec. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:78–81connectTimeoutSeconds
public E2bFilesystemSpec connectTimeoutSeconds(int connectTimeoutSeconds)
设置连接超时秒。
Performs the connect timeout seconds operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
connectTimeoutSeconds | int | 连接超时秒(类型 `int`)。The connect timeout seconds. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:83–86readTimeoutSeconds
public E2bFilesystemSpec readTimeoutSeconds(int readTimeoutSeconds)
设置读取超时秒。
Performs the read timeout seconds operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
readTimeoutSeconds | int | 读取超时秒(类型 `int`)。The read timeout seconds. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:88–91maxRetries
public E2bFilesystemSpec maxRetries(int maxRetries)
设置最大重试。
Performs the max retries operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxRetries | int | 最大重试(类型 `int`)。The max retries. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:93–96snapshotRetention
public E2bFilesystemSpec snapshotRetention(int snapshotRetention)
设置该参数。
Maximum number of snapshots created by this session that are kept on shutdown; <= 0 disables pruning.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshotRetention | int | 快照 Retention(类型 `int`)。The snapshot retention. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:104–107snapshotSpec
public E2bFilesystemSpec snapshotSpec(SandboxSnapshotSpec snapshotSpec)
设置快照规格。
Performs the snapshot spec operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshotSpec | SandboxSnapshotSpec | 快照规格(类型 `SandboxSnapshotSpec`)。The snapshot spec. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:109–112workspaceSpec
public E2bFilesystemSpec workspaceSpec(WorkspaceSpec workspaceSpec)
设置工作区规格。
Performs the workspace spec operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceSpec | WorkspaceSpec | 工作区规格(类型 `WorkspaceSpec`)。The workspace spec. |
E2bFilesystemSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:114–117createClient
protected SandboxClient<?> createClient()
创建客户端。
Creates the client.
SandboxClient<?>io/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:119–122clientOptions
protected SandboxClientOptions clientOptions()
返回客户端选项。
Returns the client options.
SandboxClientOptionsio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:124–127snapshotSpec
protected SandboxSnapshotSpec snapshotSpec()
返回快照规格。
Returns the snapshot spec.
SandboxSnapshotSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:129–132workspaceSpec
protected WorkspaceSpec workspaceSpec()
返回工作区规格。
Returns the workspace spec.
WorkspaceSpecio/agentscope/extensions/sandbox/e2b/E2bFilesystemSpec.java:134–137