This commit is contained in:
Thomas Dhome-Casanova
2025-01-31 20:02:58 -08:00
parent e268184f8d
commit be506b2d09
3 changed files with 51 additions and 66 deletions

View File

@@ -28,6 +28,8 @@ Action = Literal[
"double_click",
"screenshot",
"cursor_position",
"hover",
"wait"
]
@@ -213,7 +215,11 @@ class ComputerTool(BaseAnthropicTool):
elif action == "scroll_down":
self.send_to_vm("pyautogui.scroll(-100)")
return ToolResult(output=f"Performed {action}")
if action == "hover":
return ToolResult(output=f"Performed {action}")
if action == "wait":
time.sleep(1)
return ToolResult(output=f"Performed {action}")
raise ToolError(f"Invalid action: {action}")
def send_to_vm(self, action: str):