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.

prompt uitars to use the correct hotkeys on mac

Dillon DuPontf580be07a1f8
diff --git a/libs/agent/agent/providers/uitars/loop.py b/libs/agent/agent/providers/uitars/loop.py
index 99132365c5..84393bd2d7 100644
--- a/libs/agent/agent/providers/uitars/loop.py
+++ b/libs/agent/agent/providers/uitars/loop.py
@@ -20,7 +20,7 @@ from computer import Computer
from .utils import add_box_token, parse_actions, parse_action_parameters
from .tools.manager import ToolManager
from .tools.computer import ToolResult
-from .prompts import COMPUTER_USE, SYSTEM_PROMPT
+from .prompts import COMPUTER_USE, SYSTEM_PROMPT, MAC_SPECIFIC_NOTES
from .clients.oaicompat import OAICompatClient
@@ -184,7 +184,7 @@ class UITARSLoop(BaseLoop):
if first_user_idx is not None and instruction:
# Create the computer use prompt
user_prompt = COMPUTER_USE.format(
- instruction=instruction,
+ instruction='\n'.join([instruction, MAC_SPECIFIC_NOTES]),
language="English"
)
diff --git a/libs/agent/agent/providers/uitars/prompts.py b/libs/agent/agent/providers/uitars/prompts.py
index aa24557dce..fe16f0d8f7 100644
--- a/libs/agent/agent/providers/uitars/prompts.py
+++ b/libs/agent/agent/providers/uitars/prompts.py
@@ -1,5 +1,9 @@
"""Prompts for UI-TARS agent."""
+MAC_SPECIFIC_NOTES = """
+(You are operating on macOS, use 'cmd' instead of 'ctrl' for most shortcuts e.g., hotkey(key='cmd c') for copy, hotkey(key='cmd v') for paste, hotkey(key='cmd t') for new tab).)
+"""
+
SYSTEM_PROMPT = "You are a helpful assistant."
COMPUTER_USE = """You are a GUI agent. You are given a task and your action history, with screenshots. You need to perform the next action to complete the task.
@@ -56,4 +60,4 @@ finished(content='xxx') # Use escape characters \\', \\", and \\n in content par
## User Instruction
{instruction}
-"""
\ No newline at end of file
+"""