AgentRunSandboxState
public class AgentRunSandboxState extends SandboxState
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_ROOTstaticfinal | 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
默认工作区根字段。声明为 public static final String DEFAULT_WORKSPACE_ROOT。
Default workspace root path inside an AgentRun sandbox container.
io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:24方法详情Method Detail
getSandboxId
public String getSandboxId()
获取沙箱标识。
Returns the sandbox id.
Stringio/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:35–37setSandboxId
public void setSandboxId(String sandboxId)
设置沙箱标识。
Sets the sandbox id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxId | String | 沙箱标识(类型 `String`)。The sandbox id. |
io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:39–41getWorkspaceRoot
public String getWorkspaceRoot()
获取工作区根。
Returns the workspace root.
Stringio/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:43–45setWorkspaceRoot
public void setWorkspaceRoot(String workspaceRoot)
设置工作区根。
Sets the workspace root.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceRoot | String | 工作区根(类型 `String`)。The workspace root. |
io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:47–49getTemplateName
public String getTemplateName()
获取模板名称。
Returns the template name.
Stringio/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:51–53setTemplateName
public void setTemplateName(String templateName)
设置模板名称。
Sets the template name.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
templateName | String | 模板名称(类型 `String`)。The template name. |
io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:55–57getAccountId
public String getAccountId()
获取 getAccountId。
Returns the account id.
Stringio/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:59–61setAccountId
public void setAccountId(String accountId)
设置 setAccountId。
Sets the account id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
accountId | String | account 标识(类型 `String`)。The account id. |
io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:63–65getRegion
public String getRegion()
获取区域。
Returns the region.
Stringio/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:67–69setRegion
public void setRegion(String region)
设置区域。
Sets the region.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
region | String | 区域(类型 `String`)。The region. |
io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:71–73getMcpServerUrl
public String getMcpServerUrl()
获取MCP 服务端 URL。
Returns the mcp server url.
Stringio/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:75–77setMcpServerUrl
public void setMcpServerUrl(String mcpServerUrl)
设置MCP 服务端 URL。
Sets the mcp server url.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mcpServerUrl | String | MCP 服务端 URL(类型 `String`)。The mcp server url. |
io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:79–81isSandboxOwned
public boolean isSandboxOwned()
判断是否 isSandboxOwned。
Returns whether the sandbox owned.
booleanio/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:83–85setSandboxOwned
public void setSandboxOwned(boolean sandboxOwned)
设置 setSandboxOwned。
Sets the sandbox owned.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxOwned | boolean | 沙箱 Owned(类型 `boolean`)。The sandbox owned. |
io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:87–89isWorkspaceOnNas
public boolean isWorkspaceOnNas()
判断是否 isWorkspaceOnNas。
Returns whether #workspaceRoot lives on a NAS or OSS persistent mount.
booleanio/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:100–102setWorkspaceOnNas
public void setWorkspaceOnNas(boolean workspaceOnNas)
设置 setWorkspaceOnNas。
Sets the workspace on nas.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceOnNas | boolean | 工作区 On Nas(类型 `boolean`)。The workspace on nas. |
io/agentscope/extensions/sandbox/agentrun/AgentRunSandboxState.java:104–106