Skip to content

Commit 6519a12

Browse files
committed
Add operating_system to format prompt string with it
1 parent b9b7786 commit 6519a12

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

operate/models/prompts.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
"""
201201

202202
SYSTEM_PROMPT_OCR = """
203-
You are operating a computer, using the same operating system as a human.
203+
You are operating a {operating_system} computer, using the same operating system as a human.
204204
205205
From looking at the screen, the objective, and your previous actions, take the next best series of action.
206206
@@ -227,7 +227,7 @@
227227
228228
Here a helpful example:
229229
230-
Example 1: Opens Spotlight Search on Mac and open Google Chrome
230+
Example 1: Searches for Google Chrome on the OS and opens it
231231
```
232232
[
233233
{{ "thought": "Searching the operating system to find Google Chrome because it appears I am currently in terminal", "operation": "press", "keys": {os_search_str} }},
@@ -285,9 +285,15 @@ def get_system_prompt(model, objective):
285285
if platform.system() == "Darwin":
286286
cmd_string = "command"
287287
os_search_str = ["command", "space"]
288+
operating_system = "Mac"
289+
elif platform.system() == "Windows":
290+
cmd_string = "ctrl"
291+
os_search_str = ["win"]
292+
operating_system = "Windows"
288293
else:
289294
cmd_string = "ctrl"
290295
os_search_str = ["win"]
296+
operating_system = "Linux"
291297

292298
if model == "gpt-4-with-som":
293299
if platform.system() == "Darwin":
@@ -296,7 +302,10 @@ def get_system_prompt(model, objective):
296302
prompt = SYSTEM_PROMPT_LABELED_WIN_LINUX.format(objective=objective)
297303
elif model == "gpt-4-with-ocr":
298304
prompt = SYSTEM_PROMPT_OCR.format(
299-
objective=objective, cmd_string=cmd_string, os_search_str=os_search_str
305+
objective=objective,
306+
cmd_string=cmd_string,
307+
os_search_str=os_search_str,
308+
operating_system=operating_system,
300309
)
301310
else:
302311
if platform.system() == "Darwin":
@@ -307,7 +316,6 @@ def get_system_prompt(model, objective):
307316
# Optional verbose output
308317
if config.verbose:
309318
print("[get_system_prompt] model:", model)
310-
print("\n\n\n\n[get_system_prompt] prompt:", prompt, "\n\n\n\n")
311319

312320
return prompt
313321

0 commit comments

Comments
 (0)