diff --git a/libs/python/agent/agent/agent.py b/libs/python/agent/agent/agent.py index 8120109d..b796866d 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