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.

Force default model for human-in-the-loop

Dillon DuPont038ad4df10cb
diff --git a/libs/python/agent/agent/agent.py b/libs/python/agent/agent/agent.py
index 8120109d80..b796866dd2 100644
--- a/libs/python/agent/agent/agent.py
+++ b/libs/python/agent/agent/agent.py
@@ -188,7 +188,11 @@ class ComputerAgent:
max_trajectory_budget: If set, adds BudgetManagerCallback to track usage costs and stop when budget is exceeded
telemetry_enabled: If set, adds TelemetryCallback to track anonymized usage data. Enabled by default.
**kwargs: Additional arguments passed to the agent loop
- """
+ """
+ # If the loop is "human/human", we need to prefix a grounding model fallback
+ if model in ["human/human", "human"]:
+ model = "openai/computer-use-preview+human/human"
+
self.model = model
self.tools = tools or []
self.custom_loop = custom_loop
@@ -253,10 +257,6 @@ class ComputerAgent:
# == Initialize computer agent ==
- # If the loop is "human/human", we need to prefix a grounding model fallback
- if model in ["human/human", "human"]:
- model = "openai/computer-use-preview+human/human"
-
# Find the appropriate agent loop
if custom_loop:
self.agent_loop = custom_loop