AS AgentScopeAPI 手册 / API Reference

AgentRunSandboxState

public class AgentRunSandboxState extends SandboxState
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:21–107

智能体运行沙箱状态,在隔离环境中安全执行代码和工具。位于 io.agentscope.extensions.sandbox.agentrun 包,继承自 SandboxState。核心成员包括 getSandboxId、setSandboxId、getWorkspaceRoot、setWorkspaceRoot、getTemplateName、setTemplateName。

Serializable state for an AgentRun-backed sandbox.

字段摘要Field Summary

字段Field类型Type说明Description
DEFAULT_WORKSPACE_ROOT
staticfinal
String
默认工作区根字段。
Default workspace root path inside an AgentRun sandbox container.

方法摘要Method Summary

方法Method说明Description
public String getSandboxId()
获取沙箱标识。
Returns the sandbox id.
public void setSandboxId(String sandboxId)
设置沙箱标识。
Sets the sandbox id.
public String getWorkspaceRoot()
获取工作区根。
Returns the workspace root.
public void setWorkspaceRoot(String workspaceRoot)
设置工作区根。
Sets the workspace root.
public String getTemplateName()
获取模板名称。
Returns the template name.
public void setTemplateName(String templateName)
设置模板名称。
Sets the template name.
public String getAccountId()
获取 `getAccountId`。
Returns the account id.
public void setAccountId(String accountId)
设置 `setAccountId`。
Sets the account id.
public String getRegion()
获取区域。
Returns the region.
public void setRegion(String region)
设置区域。
Sets the region.
public String getMcpServerUrl()
获取MCP 服务端 URL。
Returns the mcp server url.
public void setMcpServerUrl(String mcpServerUrl)
设置MCP 服务端 URL。
Sets the mcp server url.
public boolean isSandboxOwned()
判断是否 `isSandboxOwned`。
Returns whether the sandbox owned.
public void setSandboxOwned(boolean sandboxOwned)
设置 `setSandboxOwned`。
Sets the sandbox owned.
public boolean isWorkspaceOnNas()
判断是否 `isWorkspaceOnNas`。
Returns whether `#workspaceRoot` lives on a NAS or OSS persistent mount.
public void setWorkspaceOnNas(boolean workspaceOnNas)
设置 `setWorkspaceOnNas`。
Sets the workspace on nas.

字段详情Field Detail

DEFAULT_WORKSPACE_ROOT

public static final String DEFAULT_WORKSPACE_ROOT
staticfinal

默认工作区根字段。声明为 public static final String DEFAULT_WORKSPACE_ROOT。

Default workspace root path inside an AgentRun sandbox container.

源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:24

方法详情Method Detail

getSandboxId

public String getSandboxId()

获取沙箱标识。

Returns the sandbox id.

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

setSandboxId

public void setSandboxId(String sandboxId)

设置沙箱标识。

Sets the sandbox id.

参数Parameters
名称Name类型Type说明Description
sandboxIdString沙箱标识(类型 `String`)。The sandbox id.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:39–41

getWorkspaceRoot

public String getWorkspaceRoot()

获取工作区根。

Returns the workspace root.

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

setWorkspaceRoot

public void setWorkspaceRoot(String workspaceRoot)

设置工作区根。

Sets the workspace root.

参数Parameters
名称Name类型Type说明Description
workspaceRootString工作区根(类型 `String`)。The workspace root.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:47–49

getTemplateName

public String getTemplateName()

获取模板名称。

Returns the template name.

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

setTemplateName

public void setTemplateName(String templateName)

设置模板名称。

Sets the template name.

参数Parameters
名称Name类型Type说明Description
templateNameString模板名称(类型 `String`)。The template name.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:55–57

getAccountId

public String getAccountId()

获取 getAccountId。

Returns the account id.

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

setAccountId

public void setAccountId(String accountId)

设置 setAccountId。

Sets the account id.

参数Parameters
名称Name类型Type说明Description
accountIdStringaccount 标识(类型 `String`)。The account id.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:63–65

getRegion

public String getRegion()

获取区域。

Returns the region.

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

setRegion

public void setRegion(String region)

设置区域。

Sets the region.

参数Parameters
名称Name类型Type说明Description
regionString区域(类型 `String`)。The region.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:71–73

getMcpServerUrl

public String getMcpServerUrl()

获取MCP 服务端 URL。

Returns the mcp server url.

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

setMcpServerUrl

public void setMcpServerUrl(String mcpServerUrl)

设置MCP 服务端 URL。

Sets the mcp server url.

参数Parameters
名称Name类型Type说明Description
mcpServerUrlStringMCP 服务端 URL(类型 `String`)。The mcp server url.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:79–81

isSandboxOwned

public boolean isSandboxOwned()

判断是否 isSandboxOwned。

Returns whether the sandbox owned.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:83–85

setSandboxOwned

public void setSandboxOwned(boolean sandboxOwned)

设置 setSandboxOwned。

Sets the sandbox owned.

参数Parameters
名称Name类型Type说明Description
sandboxOwnedboolean沙箱 Owned(类型 `boolean`)。The sandbox owned.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:87–89

isWorkspaceOnNas

public boolean isWorkspaceOnNas()

判断是否 isWorkspaceOnNas。

Returns whether #workspaceRoot lives on a NAS or OSS persistent mount.

返回Returns boolean
返回布尔值,表示判断结果。true when the workspace root is backed by a persistent mount
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:100–102

setWorkspaceOnNas

public void setWorkspaceOnNas(boolean workspaceOnNas)

设置 setWorkspaceOnNas。

Sets the workspace on nas.

参数Parameters
名称Name类型Type说明Description
workspaceOnNasboolean工作区 On Nas(类型 `boolean`)。The workspace on nas.
源码Source io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:104–106

继承成员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.