AS AgentScopeAPI 手册 / API Reference

AgentRunSandboxClientOptions

public class AgentRunSandboxClientOptions extends SandboxClientOptions
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:26–277

用于AgentRunSandboxClient的选项。位于 io.agentscope.extensions.sandbox.agentrun 包,继承自 SandboxClientOptions。核心成员包括 getType、createClient、validate、getResolvedDataPlaneBaseUrl、getHttpClient、setHttpClient。

Options for AgentRunSandboxClient.

字段摘要Field Summary

字段Field类型Type说明Description
MAX_OSS_MOUNTS
staticfinal
int
最大 OSS MOUNTS字段。
Maximum number of instance-level OSS mounts AgentRun accepts per sandbox.
ALLOWED_MOUNT_PREFIXES
staticfinal
List<String>
已允许 MOUNT PREFIXES字段。
Allowed mount-dir prefixes for both NAS and OSS instance mounts.

方法摘要Method Summary

方法Method说明Description
public String getType()
获取类型。
Returns the type.
public SandboxClient<? extends SandboxClientOptions> createClient()
创建客户端。
Creates the client.
public void validate()
执行校验相关操作。
Validates option invariants that are independent of any active sandbox.
public String getResolvedDataPlaneBaseUrl()
获取已解析数据面基类 URL。
Returns the resolved data-plane base URL, deriving it from `accountId`/`region` when not explicitly set.
public OkHttpClient getHttpClient()
获取HTTP 客户端。
Returns the http client.
public AgentRunSandboxClientOptions setHttpClient(OkHttpClient httpClient)
设置HTTP 客户端。
Sets the http client.
public String getApiKey()
获取API 键。
Returns the api key.
public AgentRunSandboxClientOptions setApiKey(String apiKey)
设置API 键。
Sets the api key.
public String getAccountId()
获取 `getAccountId`。
Returns the account id.
public AgentRunSandboxClientOptions setAccountId(String accountId)
设置 `setAccountId`。
Sets the account id.
public String getRegion()
获取区域。
Returns the region.
public AgentRunSandboxClientOptions setRegion(String region)
设置区域。
Sets the region.
public String getDataPlaneBaseUrl()
获取数据面基类 URL。
Returns the data plane base url.
public AgentRunSandboxClientOptions setDataPlaneBaseUrl(String dataPlaneBaseUrl)
设置数据面基类 URL。
Sets the data plane base url.
public String getTemplateName()
获取模板名称。
Returns the template name.
public AgentRunSandboxClientOptions setTemplateName(String templateName)
设置模板名称。
Sets the template name.
public String getMcpServerUrl()
获取MCP 服务端 URL。
Returns the mcp server url.
public AgentRunSandboxClientOptions setMcpServerUrl(String mcpServerUrl)
设置MCP 服务端 URL。
Sets the mcp server url.
public String getMcpEndpoint()
获取MCP 端点。
Returns the mcp endpoint.
public AgentRunSandboxClientOptions setMcpEndpoint(String mcpEndpoint)
设置MCP 端点。
Sets the mcp endpoint.
public int getSandboxIdleTimeoutSeconds()
获取 `getSandboxIdleTimeoutSeconds`。
Returns the sandbox idle timeout seconds.
public AgentRunSandboxClientOptions setSandboxIdleTimeoutSeconds(int seconds)
设置 `setSandboxIdleTimeoutSeconds`。
Sets the sandbox idle timeout seconds.
public AgentRunNasMountConfig getNasConfig()
获取 `getNasConfig`。
Returns the nas config.
public AgentRunSandboxClientOptions setNasConfig(AgentRunNasMountConfig nasConfig)
设置 `setNasConfig`。
Sets the nas config.
public List<AgentRunOssMountConfig> getOssMountConfigs()
获取 `getOssMountConfigs`。
Returns the oss mount configs.
public AgentRunSandboxClientOptions setOssMountConfigs(List<AgentRunOssMountConfig> ossMountConfigs)
设置 `setOssMountConfigs`。
Sets the oss mount configs.
public AgentRunSandboxClientOptions addOssMount(AgentRunOssMountConfig mount)
添加 `addOssMount`。
Adds the oss mount.
public String getWorkspaceRoot()
获取工作区根。
Returns the workspace root.
public AgentRunSandboxClientOptions setWorkspaceRoot(String workspaceRoot)
设置工作区根。
Sets the workspace root.
public int getConnectTimeoutSeconds()
获取连接超时秒。
Returns the connect timeout seconds.
public AgentRunSandboxClientOptions setConnectTimeoutSeconds(int connectTimeoutSeconds)
设置连接超时秒。
Sets the connect timeout seconds.
public int getReadTimeoutSeconds()
获取读取超时秒。
Returns the read timeout seconds.
public AgentRunSandboxClientOptions setReadTimeoutSeconds(int readTimeoutSeconds)
设置读取超时秒。
Sets the read timeout seconds.
public int getMaxRetries()
获取最大重试。
Returns the max retries.
public AgentRunSandboxClientOptions setMaxRetries(int maxRetries)
设置最大重试。
Sets the max retries.

字段详情Field Detail

MAX_OSS_MOUNTS

public static final int MAX_OSS_MOUNTS
staticfinal

最大 OSS MOUNTS字段。声明为 public static final int MAX_OSS_MOUNTS。

Maximum number of instance-level OSS mounts AgentRun accepts per sandbox.

源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:29

ALLOWED_MOUNT_PREFIXES

public static final List<String> ALLOWED_MOUNT_PREFIXES
staticfinal

已允许 MOUNT PREFIXES字段。声明为 public static final List ALLOWED_MOUNT_PREFIXES。

Allowed mount-dir prefixes for both NAS and OSS instance mounts.

源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:32

方法详情Method Detail

getType

public String getType()

获取类型。

Returns the type.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:50–53

createClient

public SandboxClient<? extends SandboxClientOptions> createClient()

创建客户端。

Creates the client.

返回Returns SandboxClient<? extends SandboxClientOptions>
返回SandboxClient。Returns sandbox client.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:55–58

validate

public void validate()

执行校验相关操作。

Validates option invariants that are independent of any active sandbox.

抛出Throws
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:65–97

getResolvedDataPlaneBaseUrl

public String getResolvedDataPlaneBaseUrl()

获取已解析数据面基类 URL。

Returns the resolved data-plane base URL, deriving it from accountId/region when not explicitly set.

返回Returns String
返回字符串结果。absolute data-plane base URL
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:119–128

getHttpClient

public OkHttpClient getHttpClient()

获取HTTP 客户端。

Returns the http client.

返回Returns OkHttpClient
返回OkHttpClient。Returns ok http client.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:134–136

setHttpClient

public AgentRunSandboxClientOptions setHttpClient(OkHttpClient httpClient)

设置HTTP 客户端。

Sets the http client.

参数Parameters
名称Name类型Type说明Description
httpClientOkHttpClientHTTP 客户端(类型 `OkHttpClient`)。The http client.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:138–141

getApiKey

public String getApiKey()

获取API 键。

Returns the api key.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:143–145

setApiKey

public AgentRunSandboxClientOptions setApiKey(String apiKey)

设置API 键。

Sets the api key.

参数Parameters
名称Name类型Type说明Description
apiKeyStringAPI 键(类型 `String`)。The api key.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:147–150

getAccountId

public String getAccountId()

获取 getAccountId。

Returns the account id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:152–154

setAccountId

public AgentRunSandboxClientOptions setAccountId(String accountId)

设置 setAccountId。

Sets the account id.

参数Parameters
名称Name类型Type说明Description
accountIdStringaccount 标识(类型 `String`)。The account id.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:156–159

getRegion

public String getRegion()

获取区域。

Returns the region.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:161–163

setRegion

public AgentRunSandboxClientOptions setRegion(String region)

设置区域。

Sets the region.

参数Parameters
名称Name类型Type说明Description
regionString区域(类型 `String`)。The region.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:165–168

getDataPlaneBaseUrl

public String getDataPlaneBaseUrl()

获取数据面基类 URL。

Returns the data plane base url.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:170–172

setDataPlaneBaseUrl

public AgentRunSandboxClientOptions setDataPlaneBaseUrl(String dataPlaneBaseUrl)

设置数据面基类 URL。

Sets the data plane base url.

参数Parameters
名称Name类型Type说明Description
dataPlaneBaseUrlString数据面基类 URL(类型 `String`)。The data plane base url.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:174–177

getTemplateName

public String getTemplateName()

获取模板名称。

Returns the template name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:179–181

setTemplateName

public AgentRunSandboxClientOptions setTemplateName(String templateName)

设置模板名称。

Sets the template name.

参数Parameters
名称Name类型Type说明Description
templateNameString模板名称(类型 `String`)。The template name.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:183–186

getMcpServerUrl

public String getMcpServerUrl()

获取MCP 服务端 URL。

Returns the mcp server url.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:188–190

setMcpServerUrl

public AgentRunSandboxClientOptions setMcpServerUrl(String mcpServerUrl)

设置MCP 服务端 URL。

Sets the mcp server url.

参数Parameters
名称Name类型Type说明Description
mcpServerUrlStringMCP 服务端 URL(类型 `String`)。The mcp server url.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:192–195

getMcpEndpoint

public String getMcpEndpoint()

获取MCP 端点。

Returns the mcp endpoint.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:197–199

setMcpEndpoint

public AgentRunSandboxClientOptions setMcpEndpoint(String mcpEndpoint)

设置MCP 端点。

Sets the mcp endpoint.

参数Parameters
名称Name类型Type说明Description
mcpEndpointStringMCP 端点(类型 `String`)。The mcp endpoint.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:201–204

getSandboxIdleTimeoutSeconds

public int getSandboxIdleTimeoutSeconds()

获取 getSandboxIdleTimeoutSeconds。

Returns the sandbox idle timeout seconds.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:206–208

setSandboxIdleTimeoutSeconds

public AgentRunSandboxClientOptions setSandboxIdleTimeoutSeconds(int seconds)

设置 setSandboxIdleTimeoutSeconds。

Sets the sandbox idle timeout seconds.

参数Parameters
名称Name类型Type说明Description
secondsint秒(类型 `int`)。The seconds.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:210–213

getNasConfig

public AgentRunNasMountConfig getNasConfig()

获取 getNasConfig。

Returns the nas config.

返回Returns AgentRunNasMountConfig
返回AgentRunNasMountConfig。Returns agent run nas mount config.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:215–217

setNasConfig

public AgentRunSandboxClientOptions setNasConfig(AgentRunNasMountConfig nasConfig)

设置 setNasConfig。

Sets the nas config.

参数Parameters
名称Name类型Type说明Description
nasConfigAgentRunNasMountConfignas 配置(类型 `AgentRunNasMountConfig`)。The nas config.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:219–222

getOssMountConfigs

public List<AgentRunOssMountConfig> getOssMountConfigs()

获取 getOssMountConfigs。

Returns the oss mount configs.

返回Returns List<AgentRunOssMountConfig>
返回列出。Returns list.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:224–226

setOssMountConfigs

public AgentRunSandboxClientOptions setOssMountConfigs(List<AgentRunOssMountConfig> ossMountConfigs)

设置 setOssMountConfigs。

Sets the oss mount configs.

参数Parameters
名称Name类型Type说明Description
ossMountConfigsList<AgentRunOssMountConfig>OSS Mount Configs(类型 `List`)。The oss mount configs.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:228–232

addOssMount

public AgentRunSandboxClientOptions addOssMount(AgentRunOssMountConfig mount)

添加 addOssMount。

Adds the oss mount.

参数Parameters
名称Name类型Type说明Description
mountAgentRunOssMountConfigmount(类型 `AgentRunOssMountConfig`)。The mount.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:234–239

getWorkspaceRoot

public String getWorkspaceRoot()

获取工作区根。

Returns the workspace root.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:241–243

setWorkspaceRoot

public AgentRunSandboxClientOptions setWorkspaceRoot(String workspaceRoot)

设置工作区根。

Sets the workspace root.

参数Parameters
名称Name类型Type说明Description
workspaceRootString工作区根(类型 `String`)。The workspace root.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:245–249

getConnectTimeoutSeconds

public int getConnectTimeoutSeconds()

获取连接超时秒。

Returns the connect timeout seconds.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:251–253

setConnectTimeoutSeconds

public AgentRunSandboxClientOptions setConnectTimeoutSeconds(int connectTimeoutSeconds)

设置连接超时秒。

Sets the connect timeout seconds.

参数Parameters
名称Name类型Type说明Description
connectTimeoutSecondsint连接超时秒(类型 `int`)。The connect timeout seconds.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:255–258

getReadTimeoutSeconds

public int getReadTimeoutSeconds()

获取读取超时秒。

Returns the read timeout seconds.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:260–262

setReadTimeoutSeconds

public AgentRunSandboxClientOptions setReadTimeoutSeconds(int readTimeoutSeconds)

设置读取超时秒。

Sets the read timeout seconds.

参数Parameters
名称Name类型Type说明Description
readTimeoutSecondsint读取超时秒(类型 `int`)。The read timeout seconds.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:264–267

getMaxRetries

public int getMaxRetries()

获取最大重试。

Returns the max retries.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:269–271

setMaxRetries

public AgentRunSandboxClientOptions setMaxRetries(int maxRetries)

设置最大重试。

Sets the max retries.

参数Parameters
名称Name类型Type说明Description
maxRetriesint最大重试(类型 `int`)。The max retries.
返回Returns AgentRunSandboxClientOptions
返回AgentRunSandboxClientOptions。Returns agent run sandbox client options.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxClientOptions.java:273–276
基于官方固定版本源码静态生成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.