diff --git a/README.md b/README.md index fccf0f673..320829442 100644 --- a/README.md +++ b/README.md @@ -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...") @@ -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 @@ -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...") @@ -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...") @@ -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 diff --git a/README_zh.md b/README_zh.md index a959a8632..49113a6cd 100644 --- a/README_zh.md +++ b/README_zh.md @@ -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 键继续...") @@ -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")) # 截取桌面截图 @@ -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 键继续...") @@ -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 键继续...") @@ -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 的问候!")) # 输入文本 diff --git a/cookbook/en/sandbox/sandbox.md b/cookbook/en/sandbox/sandbox.md index 0df4afaf5..97505d83f 100644 --- a/cookbook/en/sandbox/sandbox.md +++ b/cookbook/en/sandbox/sandbox.md @@ -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...") @@ -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 @@ -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...") @@ -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...") @@ -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 diff --git a/cookbook/zh/sandbox/sandbox.md b/cookbook/zh/sandbox/sandbox.md index d2ff015fa..e49881f37 100644 --- a/cookbook/zh/sandbox/sandbox.md +++ b/cookbook/zh/sandbox/sandbox.md @@ -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 键继续...") @@ -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")) # 截取桌面截图 @@ -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 键继续...") @@ -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 键继续...") @@ -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 的问候!")) # 输入文本