Update README.md

This commit is contained in:
Tianbao Xie
2024-04-02 22:18:46 +08:00
committed by GitHub
parent 7912c27721
commit 9b45f6bf00

View File

@@ -60,17 +60,40 @@ from desktop_env.envs.desktop_env import DesktopEnv
example = {
"id": "94d95f96-9699-4208-98ba-3c3119edf9c2",
"instruction": "I want to install Spotify on my current system. Could you please help me?",
"config": [{"type": "execute", "parameters": {
"command": ["python", "-c", "import pyautogui; import time; pyautogui.click(960, 540); time.sleep(0.5);"]}}],
"evaluator": {"func": "check_include_exclude", "result": {"type": "vm_command_line", "command": "which spotify"},
"expected": {"type": "rule", "rules": {"include": ["spotify"], "exclude": ["not found"]}}}
"config": [
{
"type": "execute",
"parameters": {
"command": [
"python",
"-c",
"import pyautogui; import time; pyautogui.click(960, 540); time.sleep(0.5);"
]
}
}
],
"evaluator": {
"func": "check_include_exclude",
"result": {
"type": "vm_command_line",
"command": "which spotify"
},
"expected": {
"type": "rule",
"rules": {
"include": ["spotify"],
"exclude": ["not found"]
}
}
}
}
env = DesktopEnv(
path_to_vm="Ubuntu/Ubuntu.vmx",
action_space="pyautogui",
task_config=example
action_space="pyautogui"
)
obs = env.reset()
obs = env.reset(task_config=example)
obs, reward, done, info = env.step("pyautogui.rightClick()")
```
You will see all the logs of the system running normally, including the successful creation of the environment, completion of setup, and successful execution of actions. In the end, you will observe a successful right-click on the screen, which means you are ready to go.