AS AgentScopeAPI 手册 / API Reference

GuiSandbox

@RegisterSandbox( imageName = "agentscope-registry.ap-southeast-1.cr.aliyuncs.com/agentscope/runtime-sandbox-gui:latest", sandboxType = "gui", securityLevel = "high", timeout = 60, description = "GUI Sandbox" ) public class GuiSandbox extends Sandbox
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:31–132

Gui 沙箱,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.sandbox.box 包,继承自 Sandbox。核心成员包括 getDesktopUrl、computerUse、GuiSandbox。

GUI Sandbox for desktop GUI interactions. Provides VNC desktop access and computer use functionality.

构造器摘要Constructor Summary

构造器Constructor说明Description
public GuiSandbox(SandboxService managerApi, String userId, String sessionId)
初始化 `GuiSandbox` 实例。
Creates a new instance.
public GuiSandbox(SandboxService managerApi, String userId, String sessionId, String baseUrl)
初始化 `GuiSandbox` 实例。
Creates a new instance.
public GuiSandbox(SandboxService managerApi, String userId, String sessionId, FileSystemConfig fileSystemConfig)
初始化 `GuiSandbox` 实例。
Creates a new instance.
public GuiSandbox(SandboxService managerApi, String userId, String sessionId, Map<String, String> environment)
初始化 `GuiSandbox` 实例。
Creates a new instance.
public GuiSandbox(SandboxService managerApi, String userId, String sessionId, String baseUrl, FileSystemConfig fileSystemConfig, Map<String, String> environment)
初始化 `GuiSandbox` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getDesktopUrl()
获取 `getDesktopUrl`。
Get the desktop URL for VNC access.
public String computerUse(String action)
设置该参数。
Use computer mouse and keyboard to interact with the desktop.
public String computerUse(String action, List<Double> coordinate)
执行 `computerUse` 方法。
Use computer mouse and keyboard to interact with the desktop.
public String computerUse(String action, List<Double> coordinate, String text)
执行 `computerUse` 方法。
Use computer mouse and keyboard to interact with the desktop.

构造器详情Constructor Detail

GuiSandbox

public GuiSandbox(SandboxService managerApi, String userId, String sessionId)

初始化 GuiSandbox 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
managerApiSandboxService管理器 API(类型 `SandboxService`)。The manager api.
userIdString用户标识(类型 `String`)。The user id.
sessionIdString会话标识(类型 `String`)。The session id.
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:42–44

GuiSandbox

public GuiSandbox(SandboxService managerApi, String userId, String sessionId, String baseUrl)

初始化 GuiSandbox 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
managerApiSandboxService管理器 API(类型 `SandboxService`)。The manager api.
userIdString用户标识(类型 `String`)。The user id.
sessionIdString会话标识(类型 `String`)。The session id.
baseUrlString基类 URL(类型 `String`)。The base url.
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:46–52

GuiSandbox

public GuiSandbox(SandboxService managerApi, String userId, String sessionId, FileSystemConfig fileSystemConfig)

初始化 GuiSandbox 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
managerApiSandboxService管理器 API(类型 `SandboxService`)。The manager api.
userIdString用户标识(类型 `String`)。The user id.
sessionIdString会话标识(类型 `String`)。The session id.
fileSystemConfigFileSystemConfig文件系统配置(类型 `FileSystemConfig`)。The file system config.
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:54–60

GuiSandbox

public GuiSandbox(SandboxService managerApi, String userId, String sessionId, Map<String, String> environment)

初始化 GuiSandbox 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
managerApiSandboxService管理器 API(类型 `SandboxService`)。The manager api.
userIdString用户标识(类型 `String`)。The user id.
sessionIdString会话标识(类型 `String`)。The session id.
environmentMap<String, String>环境(类型 `Map`)。The environment.
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:62–68

GuiSandbox

public GuiSandbox(SandboxService managerApi, String userId, String sessionId, String baseUrl, FileSystemConfig fileSystemConfig, Map<String, String> environment)

初始化 GuiSandbox 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
managerApiSandboxService管理器 API(类型 `SandboxService`)。The manager api.
userIdString用户标识(类型 `String`)。The user id.
sessionIdString会话标识(类型 `String`)。The session id.
baseUrlString基类 URL(类型 `String`)。The base url.
fileSystemConfigFileSystemConfig文件系统配置(类型 `FileSystemConfig`)。The file system config.
environmentMap<String, String>环境(类型 `Map`)。The environment.
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:70–79

方法详情Method Detail

getDesktopUrl

public String getDesktopUrl()

获取 getDesktopUrl。

Get the desktop URL for VNC access.

返回Returns String
返回字符串结果。The desktop URL for VNC access
抛出Throws
  • RuntimeException 可能抛出 `RuntimeException`。if sandbox is not healthy
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:88–90

computerUse

public String computerUse(String action)

设置该参数。

Use computer mouse and keyboard to interact with the desktop.

参数Parameters
名称Name类型Type说明Description
actionString动作(类型 `String`)。The action to perform (key, type, mouse_move, left_click, etc.)
返回Returns String
动作的结果。The result of the action
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:98–100

computerUse

public String computerUse(String action, List<Double> coordinate)

执行 computerUse 方法。

Use computer mouse and keyboard to interact with the desktop.

参数Parameters
名称Name类型Type说明Description
actionString动作(类型 `String`)。The action to perform (key, type, mouse_move, left_click, etc.)
coordinateList<Double>coordinate(类型 `List`)。The (x, y) coordinate for mouse actions
返回Returns String
动作的结果。The result of the action
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:109–111

computerUse

public String computerUse(String action, List<Double> coordinate, String text)

执行 computerUse 方法。

Use computer mouse and keyboard to interact with the desktop.

参数Parameters
名称Name类型Type说明Description
actionString动作(类型 `String`)。The action to perform (key, type, mouse_move, left_click, etc.)
coordinateList<Double>coordinate(类型 `List`)。The (x, y) coordinate for mouse actions
textString用于类型动作,或密钥命令用于密钥动作的文本到类型。Text to type for type action, or key command for key action
返回Returns String
动作的结果。The result of the action
源码Source io/agentscope/runtime/sandbox/box/GuiSandbox.java:121–131

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