Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

Added errors for unknown actions

Dillon DuPont5225de8d88ef
diff --git a/libs/python/agent/agent/agent.py b/libs/python/agent/agent/agent.py
index 0428b797f9..78fc3f45e5 100644
--- a/libs/python/agent/agent/agent.py
+++ b/libs/python/agent/agent/agent.py
@@ -459,8 +459,7 @@ class ComputerAgent:
assert_callable_with(computer_method, **action_args)
await computer_method(**action_args)
else:
- print(f"Unknown computer action: {action_type}")
- return []
+ raise ToolError(f"Unknown computer action: {action_type}")
# Take screenshot after action
if self.screenshot_delay and self.screenshot_delay > 0:
@@ -507,7 +506,7 @@ class ComputerAgent:
# Perform function call
function = self._get_tool(item.get("name"))
if not function:
- raise ValueError(f"Function {item.get("name")} not found")
+ raise ToolError(f"Function {item.get("name")} not found")
args = json.loads(item.get("arguments"))