Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ from agentscope_runtime.sandbox import BaseSandboxAsync

async with BaseSandboxAsync() as box:
# Default image is `agentscope/runtime-sandbox-base:latest`
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(await box.run_ipython_cell(code="print('hi')")) # Run Python code
print(await box.run_shell_command(command="echo hello")) # Run shell command
input("Press Enter to continue...")
Expand Down Expand Up @@ -336,7 +336,7 @@ from agentscope_runtime.sandbox import GuiSandboxAsync

async with GuiSandboxAsync() as box:
# Default image is `agentscope/runtime-sandbox-gui:latest`
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(box.desktop_url) # Web desktop access URL
print(await box.computer_use(action="get_cursor_position")) # Get mouse cursor position
print(await box.computer_use(action="get_screenshot")) # Capture screenshot
Expand Down Expand Up @@ -365,7 +365,7 @@ from agentscope_runtime.sandbox import BrowserSandboxAsync

async with BrowserSandboxAsync() as box:
# Default image is `agentscope/runtime-sandbox-browser:latest`
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(box.desktop_url) # Web desktop access URL
await box.browser_navigate("https://www.google.com/") # Open a webpage
input("Press Enter to continue...")
Expand Down Expand Up @@ -393,7 +393,7 @@ from agentscope_runtime.sandbox import FilesystemSandboxAsync

async with FilesystemSandboxAsync() as box:
# Default image is `agentscope/runtime-sandbox-filesystem:latest`
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(box.desktop_url) # Web desktop access URL
await box.create_directory("test") # Create a directory
input("Press Enter to continue...")
Expand Down Expand Up @@ -439,7 +439,7 @@ from agentscope_runtime.sandbox import MobileSandboxAsync

async with MobileSandboxAsync() as box:
# Default image is 'agentscope/runtime-sandbox-mobile:latest'
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(await box.mobile_get_screen_resolution()) # Get the screen resolution
print(await box.mobile_tap([500, 1000])) # Tap at coordinate (500, 1000)
print(await box.mobile_input_text("Hello from AgentScope!")) # Input text
Expand Down
10 changes: 5 additions & 5 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ from agentscope_runtime.sandbox import BaseSandboxAsync

async with BaseSandboxAsync() as box:
# 默认使用镜像 `agentscope/runtime-sandbox-base:latest` 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(await box.run_ipython_cell(code="print('你好')")) # 在沙箱中运行 Python 代码
print(await box.run_shell_command(command="echo hello")) # 在沙箱中运行 Shell 命令
input("按 Enter 键继续...")
Expand Down Expand Up @@ -338,7 +338,7 @@ from agentscope_runtime.sandbox import GuiSandboxAsync

async with GuiSandboxAsync() as box:
# 默认使用镜像 `agentscope/runtime-sandbox-gui:latest` 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(box.desktop_url) # Web 桌面访问地址
print(await box.computer_use(action="get_cursor_position")) # 获取鼠标位置坐标
print(await box.computer_use(action="get_screenshot")) # 截取桌面截图
Expand Down Expand Up @@ -367,7 +367,7 @@ from agentscope_runtime.sandbox import BrowserSandboxAsync

async with BrowserSandboxAsync() as box:
# 默认使用镜像 `agentscope/runtime-sandbox-browser:latest` 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(box.desktop_url) # Web 桌面访问地址
await box.browser_navigate("https://www.google.com/") # 打开网页
input("按 Enter 键继续...")
Expand Down Expand Up @@ -395,7 +395,7 @@ from agentscope_runtime.sandbox import FilesystemSandboxAsync

async with FilesystemSandboxAsync() as box:
# 默认使用镜像 `agentscope/runtime-sandbox-filesystem:latest` 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(box.desktop_url) # Web 桌面访问地址
await box.create_directory("test") # 创建一个目录
input("按 Enter 键继续...")
Expand Down Expand Up @@ -443,7 +443,7 @@ from agentscope_runtime.sandbox import MobileSandboxAsync

async with MobileSandboxAsync() as box:
# 默认使用镜像 'agentscope/runtime-sandbox-mobile:latest' 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(await box.mobile_get_screen_resolution()) # 获取屏幕分辨率
print(await box.mobile_tap([500, 1000])) # 在坐标 (500, 1000) 点击
print(await box.mobile_input_text("来自 AgentScope 的问候!")) # 输入文本
Expand Down
10 changes: 5 additions & 5 deletions cookbook/en/sandbox/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ from agentscope_runtime.sandbox import BaseSandboxAsync

async with BaseSandboxAsync() as box:
# Default image is `agentscope/runtime-sandbox-base:latest`
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(await box.run_ipython_cell(code="print('hi')")) # Run Python code
print(await box.run_shell_command(command="echo hello")) # Run shell command
input("Press Enter to continue...")
Expand All @@ -168,7 +168,7 @@ from agentscope_runtime.sandbox import GuiSandboxAsync

async with GuiSandboxAsync() as box:
# Default image is `agentscope/runtime-sandbox-gui:latest`
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(box.desktop_url) # Web desktop access URL
print(await box.computer_use(action="get_cursor_position")) # Get mouse cursor position
print(await box.computer_use(action="get_screenshot")) # Capture screenshot
Expand All @@ -195,7 +195,7 @@ from agentscope_runtime.sandbox import FilesystemSandboxAsync

async with FilesystemSandboxAsync() as box:
# Default image is `agentscope/runtime-sandbox-filesystem:latest`
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(box.desktop_url) # Web desktop access URL
await box.create_directory("test") # Create a directory
input("Press Enter to continue...")
Expand All @@ -221,7 +221,7 @@ from agentscope_runtime.sandbox import BrowserSandboxAsync

async with BrowserSandboxAsync() as box:
# Default image is `agentscope/runtime-sandbox-browser:latest`
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(box.desktop_url) # Web desktop access URL
await box.browser_navigate("https://www.google.com/") # Open a webpage
input("Press Enter to continue...")
Expand Down Expand Up @@ -268,7 +268,7 @@ from agentscope_runtime.sandbox import MobileSandboxAsync

async with MobileSandboxAsync() as box:
# Default image is 'agentscope/runtime-sandbox-mobile:latest'
print(await box.list_tools()) # List all available tools
print(await box.list_tools_async()) # List all available tools
print(await box.mobile_get_screen_resolution()) # Get the screen resolution
print(await box.mobile_tap([500, 1000])) # Tap at coordinate (500, 1000)
print(await box.mobile_input_text("Hello from AgentScope!")) # Input text
Expand Down
10 changes: 5 additions & 5 deletions cookbook/zh/sandbox/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ from agentscope_runtime.sandbox import BaseSandboxAsync

async with BaseSandboxAsync() as box:
# 默认使用镜像 `agentscope/runtime-sandbox-base:latest` 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(await box.run_ipython_cell(code="print('你好')")) # 在沙箱中运行 Python 代码
print(await box.run_shell_command(command="echo hello")) # 在沙箱中运行 Shell 命令
input("按 Enter 键继续...")
Expand All @@ -168,7 +168,7 @@ from agentscope_runtime.sandbox import GuiSandboxAsync

async with GuiSandboxAsync() as box:
# 默认使用镜像 `agentscope/runtime-sandbox-gui:latest` 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(box.desktop_url) # Web 桌面访问地址
print(await box.computer_use(action="get_cursor_position")) # 获取鼠标位置坐标
print(await box.computer_use(action="get_screenshot")) # 截取桌面截图
Expand All @@ -195,7 +195,7 @@ from agentscope_runtime.sandbox import FilesystemSandboxAsync

async with FilesystemSandboxAsync() as box:
# 默认使用镜像 `agentscope/runtime-sandbox-filesystem:latest` 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(box.desktop_url) # Web 桌面访问地址
await box.create_directory("test") # 创建一个目录
input("按 Enter 键继续...")
Expand All @@ -221,7 +221,7 @@ from agentscope_runtime.sandbox import BrowserSandboxAsync

async with BrowserSandboxAsync() as box:
# 默认使用镜像 `agentscope/runtime-sandbox-browser:latest` 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(box.desktop_url) # Web 桌面访问地址
await box.browser_navigate("https://www.google.com/") # 打开网页
input("按 Enter 键继续...")
Expand Down Expand Up @@ -268,7 +268,7 @@ from agentscope_runtime.sandbox import MobileSandboxAsync

async with MobileSandboxAsync() as box:
# 默认使用镜像 'agentscope/runtime-sandbox-mobile:latest' 从 DockerHub 拉取
print(await box.list_tools()) # 列出所有可用工具
print(await box.list_tools_async()) # 列出所有可用工具
print(await box.mobile_get_screen_resolution()) # 获取屏幕分辨率
print(await box.mobile_tap([500, 1000])) # 在坐标 (500, 1000) 点击
print(await box.mobile_input_text("来自 AgentScope 的问候!")) # 输入文本
Expand Down