computer-use-ootb-internal 0.0.109.post1__py3-none-any.whl → 0.0.110__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- computer_use_ootb_internal/__init__.py +1 -0
- computer_use_ootb_internal/app_teachmode.py +482 -482
- computer_use_ootb_internal/computer_use_demo/animation/test_animation.py +39 -39
- computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py +4 -3
- computer_use_ootb_internal/computer_use_demo/tools/computer.py +14 -13
- computer_use_ootb_internal/startup_utils.py +194 -0
- {computer_use_ootb_internal-0.0.109.post1.dist-info → computer_use_ootb_internal-0.0.110.dist-info}/METADATA +3 -4
- {computer_use_ootb_internal-0.0.109.post1.dist-info → computer_use_ootb_internal-0.0.110.dist-info}/RECORD +10 -10
- computer_use_ootb_internal-0.0.110.dist-info/entry_points.txt +4 -0
- computer_use_ootb_internal/computer_use_demo/gui_agent/vlm_utils/__init__.py +0 -0
- computer_use_ootb_internal/computer_use_demo/gui_agent/vlm_utils/run_vlm.py +0 -46
- computer_use_ootb_internal-0.0.109.post1.dist-info/entry_points.txt +0 -2
- {computer_use_ootb_internal-0.0.109.post1.dist-info → computer_use_ootb_internal-0.0.110.dist-info}/WHEEL +0 -0
@@ -1,40 +1,40 @@
|
|
1
|
-
"""
|
2
|
-
Test script to verify cursor animation is working
|
3
|
-
"""
|
4
|
-
import asyncio
|
5
|
-
import sys
|
6
|
-
import time
|
7
|
-
from pathlib import Path
|
8
|
-
from computer_use_ootb_internal.computer_use_demo.tools.computer import ComputerTool
|
9
|
-
|
10
|
-
async def test_animations():
|
11
|
-
|
12
|
-
# Initialize the computer tool
|
13
|
-
computer = ComputerTool()
|
14
|
-
|
15
|
-
# Test mouse move animation
|
16
|
-
print("Testing mouse move animation...")
|
17
|
-
await computer(action="mouse_move_windll", coordinate=(500, 500))
|
18
|
-
print("Waiting 2 seconds...")
|
19
|
-
await asyncio.sleep(2)
|
20
|
-
|
21
|
-
# Test click animation
|
22
|
-
print("Testing click animation...")
|
23
|
-
await computer(action="left_click_windll", coordinate=(700, 300))
|
24
|
-
print("Waiting 2 seconds...")
|
25
|
-
await asyncio.sleep(2)
|
26
|
-
|
27
|
-
# Test another move
|
28
|
-
print("Testing move and click sequence...")
|
29
|
-
await computer(action="mouse_move_windll", coordinate=(300, 300))
|
30
|
-
await asyncio.sleep(1)
|
31
|
-
await computer(action="left_click_windll", coordinate=(300, 300))
|
32
|
-
|
33
|
-
# Wait for animations to complete
|
34
|
-
print("Waiting for animations to complete...")
|
35
|
-
await asyncio.sleep(3)
|
36
|
-
|
37
|
-
print("Test completed")
|
38
|
-
|
39
|
-
if __name__ == "__main__":
|
1
|
+
"""
|
2
|
+
Test script to verify cursor animation is working
|
3
|
+
"""
|
4
|
+
import asyncio
|
5
|
+
import sys
|
6
|
+
import time
|
7
|
+
from pathlib import Path
|
8
|
+
from computer_use_ootb_internal.computer_use_demo.tools.computer import ComputerTool
|
9
|
+
|
10
|
+
async def test_animations():
|
11
|
+
|
12
|
+
# Initialize the computer tool
|
13
|
+
computer = ComputerTool()
|
14
|
+
|
15
|
+
# Test mouse move animation
|
16
|
+
print("Testing mouse move animation...")
|
17
|
+
await computer(action="mouse_move_windll", coordinate=(500, 500))
|
18
|
+
print("Waiting 2 seconds...")
|
19
|
+
await asyncio.sleep(2)
|
20
|
+
|
21
|
+
# Test click animation
|
22
|
+
print("Testing click animation...")
|
23
|
+
await computer(action="left_click_windll", coordinate=(700, 300))
|
24
|
+
print("Waiting 2 seconds...")
|
25
|
+
await asyncio.sleep(2)
|
26
|
+
|
27
|
+
# Test another move
|
28
|
+
print("Testing move and click sequence...")
|
29
|
+
await computer(action="mouse_move_windll", coordinate=(300, 300))
|
30
|
+
await asyncio.sleep(1)
|
31
|
+
await computer(action="left_click_windll", coordinate=(300, 300))
|
32
|
+
|
33
|
+
# Wait for animations to complete
|
34
|
+
print("Waiting for animations to complete...")
|
35
|
+
await asyncio.sleep(3)
|
36
|
+
|
37
|
+
print("Test completed")
|
38
|
+
|
39
|
+
if __name__ == "__main__":
|
40
40
|
asyncio.run(test_animations())
|
@@ -92,11 +92,12 @@ class TeachmodeExecutor:
|
|
92
92
|
|
93
93
|
if isinstance(tool_result, ToolResult):
|
94
94
|
print(f"[teachmode_executor] tool_result: {tool_result}")
|
95
|
-
tool_result_message = {"role": "assistant", "content": tool_result
|
95
|
+
tool_result_message = {"role": "assistant", "content": tool_result.output, "type": "action", "action_type": tool_result.base_type}
|
96
96
|
yield tool_result_message
|
97
97
|
|
98
98
|
elif isinstance(tool_result, ToolError):
|
99
|
-
|
99
|
+
print(f"[teachmode_executor] tool_error: {tool_result}")
|
100
|
+
tool_result_message = {"role": "assistant", "content": tool_result.output, "type": "error"}
|
100
101
|
yield tool_result_message
|
101
102
|
|
102
103
|
return tool_result_message
|
@@ -134,7 +135,7 @@ class TeachmodeExecutor:
|
|
134
135
|
x, y = action_item["position"]
|
135
136
|
action_item["position"] = (int(x), int(y))
|
136
137
|
refined_output.append({"action": "mouse_move", "text": None, "coordinate": tuple(action_item["position"])})
|
137
|
-
refined_output.append({"action": "left_click", "text": None, "coordinate":
|
138
|
+
refined_output.append({"action": "left_click", "text": None, "coordinate": tuple(action_item["position"])})
|
138
139
|
|
139
140
|
elif action_item["action"] == "INPUT": # 2. input -> type
|
140
141
|
if "text" in action_item:
|
@@ -293,36 +293,37 @@ class ComputerTool(BaseAnthropicTool):
|
|
293
293
|
):
|
294
294
|
if text is not None:
|
295
295
|
raise ToolError(output=f"text is not accepted for {action}", base_type="error")
|
296
|
+
# if coordinate is not None:
|
297
|
+
# raise ToolError(output=f"coordinate is not accepted for {action}", base_type="error")
|
298
|
+
|
296
299
|
if coordinate is not None:
|
297
|
-
|
300
|
+
x, y = coordinate
|
301
|
+
else:
|
302
|
+
x, y = pyautogui.position()
|
298
303
|
|
299
304
|
if action == "left_click":
|
300
|
-
x, y = pyautogui.position()
|
301
305
|
show_click(x, y)
|
302
|
-
pyautogui.click()
|
306
|
+
pyautogui.click(x=x, y=y)
|
303
307
|
return ToolResult(output="Left click", base_type="click")
|
304
308
|
elif action == "right_click":
|
305
|
-
x, y = pyautogui.position()
|
306
309
|
show_click(x, y)
|
307
|
-
pyautogui.rightClick()
|
310
|
+
pyautogui.rightClick(x=x, y=y)
|
308
311
|
return ToolResult(output="Right click", base_type="click")
|
309
312
|
elif action == "middle_click":
|
310
|
-
x, y = pyautogui.position()
|
311
313
|
show_click(x, y)
|
312
|
-
pyautogui.middleClick()
|
314
|
+
pyautogui.middleClick(x=x, y=y)
|
313
315
|
return ToolResult(output="Middle click", base_type="click")
|
314
316
|
elif action == "double_click":
|
315
|
-
x, y = pyautogui.position()
|
316
317
|
show_click(x, y)
|
317
|
-
pyautogui.doubleClick()
|
318
|
+
pyautogui.doubleClick(x=x, y=y)
|
318
319
|
return ToolResult(output="Double click", base_type="click")
|
319
320
|
elif action == "left_press":
|
320
|
-
x, y = pyautogui.position()
|
321
321
|
show_click(x, y)
|
322
|
-
pyautogui.mouseDown()
|
322
|
+
pyautogui.mouseDown(x=x, y=y)
|
323
323
|
time.sleep(1)
|
324
|
-
pyautogui.mouseUp()
|
324
|
+
pyautogui.mouseUp(x=x, y=y)
|
325
325
|
return ToolResult(output="Left press", base_type="click")
|
326
|
+
|
326
327
|
elif action == "scroll_down":
|
327
328
|
pyautogui.scroll(-200) # Adjust scroll amount as needed
|
328
329
|
return ToolResult(output="Scrolled down", base_type="scroll")
|
@@ -391,7 +392,7 @@ class ComputerTool(BaseAnthropicTool):
|
|
391
392
|
x1 = coordinate[0]+self.offset_x
|
392
393
|
y1 = coordinate[1]+self.offset_y
|
393
394
|
|
394
|
-
show_move_to(x0, y0, x1, y1
|
395
|
+
show_move_to(x0, y0, x1, y1)
|
395
396
|
self.marbot_auto_gui.moveTo(x=x1, y=y1)
|
396
397
|
|
397
398
|
return ToolResult(output=f"Mouse move", base_type="move")
|
@@ -0,0 +1,194 @@
|
|
1
|
+
import sys
|
2
|
+
import os
|
3
|
+
import winreg
|
4
|
+
import ctypes
|
5
|
+
import platform
|
6
|
+
import shutil
|
7
|
+
import subprocess
|
8
|
+
import pathlib
|
9
|
+
|
10
|
+
REG_PATH = r"Software\Microsoft\Windows\CurrentVersion\Run"
|
11
|
+
APP_NAME = "OOTBLite" # Or a more specific name for your app's startup entry
|
12
|
+
# The package name as installed by pip
|
13
|
+
PACKAGE_NAME = "computer-use-ootb-internal"
|
14
|
+
# The main module to run at startup
|
15
|
+
STARTUP_MODULE = "computer_use_ootb_internal.app_teachmode"
|
16
|
+
# Name for the scheduled task
|
17
|
+
TASK_NAME = "OOTBLite_AutoUpdate"
|
18
|
+
|
19
|
+
def is_admin():
|
20
|
+
"""Check if the script is running with administrative privileges."""
|
21
|
+
try:
|
22
|
+
return ctypes.windll.shell32.IsUserAnAdmin()
|
23
|
+
except:
|
24
|
+
return False
|
25
|
+
|
26
|
+
def get_python_executable():
|
27
|
+
"""Gets the quoted path to the current python executable."""
|
28
|
+
python_exe = sys.executable
|
29
|
+
if " " in python_exe and not python_exe.startswith('"'):
|
30
|
+
python_exe = f'"{python_exe}"'
|
31
|
+
return python_exe
|
32
|
+
|
33
|
+
def get_pip_executable():
|
34
|
+
"""Tries to locate the pip executable in the same environment."""
|
35
|
+
python_path = pathlib.Path(sys.executable)
|
36
|
+
# Common location is ../Scripts/pip.exe relative to python.exe
|
37
|
+
pip_path = python_path.parent / "Scripts" / "pip.exe"
|
38
|
+
if pip_path.exists():
|
39
|
+
# Quote if necessary
|
40
|
+
pip_exe = str(pip_path)
|
41
|
+
if " " in pip_exe and not pip_exe.startswith('"'):
|
42
|
+
pip_exe = f'"{pip_exe}"'
|
43
|
+
return pip_exe
|
44
|
+
else:
|
45
|
+
# Fallback: try using 'python -m pip'
|
46
|
+
print("Warning: pip.exe not found in Scripts directory. Falling back to 'python -m pip'.", file=sys.stderr)
|
47
|
+
return f"{get_python_executable()} -m pip"
|
48
|
+
|
49
|
+
def run_powershell_command(command):
|
50
|
+
"""Executes a PowerShell command and handles output/errors."""
|
51
|
+
try:
|
52
|
+
# Use powershell.exe - it's more universally available than pwsh.exe
|
53
|
+
# capture_output=True suppresses output unless there's an error
|
54
|
+
# text=True decodes output/error streams
|
55
|
+
# check=True raises CalledProcessError on non-zero exit codes
|
56
|
+
result = subprocess.run(
|
57
|
+
["powershell.exe", "-NoProfile", "-Command", command],
|
58
|
+
capture_output=True, text=True, check=True, encoding='utf-8'
|
59
|
+
)
|
60
|
+
print(f"PowerShell command executed successfully.")
|
61
|
+
if result.stdout:
|
62
|
+
print("Output:\n", result.stdout)
|
63
|
+
return True
|
64
|
+
except FileNotFoundError:
|
65
|
+
print("Error: 'powershell.exe' not found. Cannot manage scheduled tasks.", file=sys.stderr)
|
66
|
+
return False
|
67
|
+
except subprocess.CalledProcessError as e:
|
68
|
+
print(f"Error executing PowerShell command:", file=sys.stderr)
|
69
|
+
print(f" Command: {e.cmd}", file=sys.stderr)
|
70
|
+
print(f" Exit Code: {e.returncode}", file=sys.stderr)
|
71
|
+
print(f" Stderr: {e.stderr}", file=sys.stderr)
|
72
|
+
print(f" Stdout: {e.stdout}", file=sys.stderr)
|
73
|
+
return False
|
74
|
+
except Exception as e:
|
75
|
+
print(f"An unexpected error occurred running PowerShell: {e}", file=sys.stderr)
|
76
|
+
return False
|
77
|
+
|
78
|
+
|
79
|
+
def configure_startup():
|
80
|
+
"""Adds the application to Windows startup and sets up auto-update task."""
|
81
|
+
if platform.system() != "Windows":
|
82
|
+
print("Error: This utility is only for Windows.", file=sys.stderr)
|
83
|
+
sys.exit(1)
|
84
|
+
|
85
|
+
if not is_admin():
|
86
|
+
print("Error: This utility requires administrative privileges.", file=sys.stderr)
|
87
|
+
print("Please run this command from an Administrator Command Prompt or PowerShell.", file=sys.stderr)
|
88
|
+
sys.exit(1)
|
89
|
+
|
90
|
+
# 1. Configure Registry for Startup
|
91
|
+
print("Configuring registry for application startup...")
|
92
|
+
python_exe = get_python_executable()
|
93
|
+
startup_command = f'{python_exe} -m {STARTUP_MODULE}'
|
94
|
+
try:
|
95
|
+
key = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, REG_PATH)
|
96
|
+
winreg.SetValueEx(key, APP_NAME, 0, winreg.REG_SZ, startup_command)
|
97
|
+
winreg.CloseKey(key)
|
98
|
+
print(f"Success: Registry key HKLM\{REG_PATH}\{APP_NAME} set.")
|
99
|
+
print(f" Command: {startup_command}")
|
100
|
+
except OSError as e:
|
101
|
+
print(f"Error: Failed to set registry key HKLM\{REG_PATH}\{APP_NAME}", file=sys.stderr)
|
102
|
+
print(f"Details: {e}", file=sys.stderr)
|
103
|
+
# Continue to task setup even if registry fails? Or exit? Let's exit for now.
|
104
|
+
sys.exit(1)
|
105
|
+
except Exception as e:
|
106
|
+
print(f"An unexpected error occurred setting registry key: {e}", file=sys.stderr)
|
107
|
+
sys.exit(1)
|
108
|
+
|
109
|
+
# 2. Configure Scheduled Task for Auto-Update
|
110
|
+
print("\nConfiguring scheduled task for automatic updates...")
|
111
|
+
pip_command = get_pip_executable()
|
112
|
+
if not pip_command:
|
113
|
+
print("Error: Could not determine pip command. Skipping scheduled task setup.", file=sys.stderr)
|
114
|
+
sys.exit(1) # Exit if we can't find pip
|
115
|
+
|
116
|
+
update_command_args = f'install --upgrade --no-cache-dir {PACKAGE_NAME}'
|
117
|
+
# Need to handle quoting args for PowerShell if pip_command includes python.exe
|
118
|
+
pip_exe_path = pip_command.split()[0]
|
119
|
+
if "-m pip" in pip_command:
|
120
|
+
ps_args = f"-m pip {update_command_args}"
|
121
|
+
else:
|
122
|
+
ps_args = update_command_args
|
123
|
+
|
124
|
+
# PowerShell commands to create the task
|
125
|
+
# Define Action, Trigger, Principal, Settings, and then Register
|
126
|
+
# Note: Escaping quotes for PowerShell within Python string
|
127
|
+
# Ensure executable path and arguments are properly quoted for PowerShell
|
128
|
+
# Use triple-double quotes for f-strings containing single-quoted PowerShell strings
|
129
|
+
action = f"""$Action = New-ScheduledTaskAction -Execute '{pip_exe_path}' -Argument '{ps_args.replace("'", "''")}'""" # Escape single quotes in args for PS string
|
130
|
+
# Trigger: Daily, repeat every hour indefinitely
|
131
|
+
trigger = f"""$Trigger = New-ScheduledTaskTrigger -Daily -At 3am; $Trigger.Repetition.Interval = 'PT1H'; $Trigger.Repetition.Duration = 'P10675199D'""" # Using large duration for 'indefinitely'
|
132
|
+
# Principal: Run as SYSTEM user
|
133
|
+
principal = f"""$Principal = New-ScheduledTaskPrincipal -UserId 'SYSTEM' -LogonType ServiceAccount -RunLevel Highest"""
|
134
|
+
# Settings: Allow start if on batteries, don't stop if goes off batteries (adjust as needed)
|
135
|
+
settings = f"""$Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable""" # Added StartWhenAvailable
|
136
|
+
|
137
|
+
# Register Task: Use -Force to overwrite if it exists
|
138
|
+
description = f"Hourly check for {PACKAGE_NAME} updates."
|
139
|
+
# Escape single quotes in description just in case PACKAGE_NAME contains them
|
140
|
+
escaped_description = description.replace("'", "''")
|
141
|
+
register_command = f"""{action}; {trigger}; {principal}; {settings}; Register-ScheduledTask -TaskName '{TASK_NAME}' -Action $Action -Trigger $Trigger -Principal $Principal -Settings $Settings -Force -Description '{escaped_description}'"""
|
142
|
+
|
143
|
+
print(f"Attempting to create/update scheduled task '{TASK_NAME}'...")
|
144
|
+
if run_powershell_command(register_command):
|
145
|
+
print(f"Success: Scheduled task '{TASK_NAME}' created/updated.")
|
146
|
+
print(f" Task Action: {pip_exe_path} {ps_args}")
|
147
|
+
else:
|
148
|
+
print(f"Error: Failed to configure scheduled task '{TASK_NAME}'. Please check PowerShell errors above.", file=sys.stderr)
|
149
|
+
# Decide if failure here is critical
|
150
|
+
# sys.exit(1)
|
151
|
+
|
152
|
+
|
153
|
+
def remove_startup():
|
154
|
+
"""Removes the application from Windows startup and removes auto-update task."""
|
155
|
+
if platform.system() != "Windows":
|
156
|
+
print("Error: This utility is only for Windows.", file=sys.stderr)
|
157
|
+
sys.exit(1)
|
158
|
+
|
159
|
+
if not is_admin():
|
160
|
+
print("Error: This utility requires administrative privileges.", file=sys.stderr)
|
161
|
+
print("Please run this command from an Administrator Command Prompt or PowerShell.", file=sys.stderr)
|
162
|
+
sys.exit(1)
|
163
|
+
|
164
|
+
# 1. Remove Registry Key
|
165
|
+
print("Removing registry key...")
|
166
|
+
try:
|
167
|
+
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, REG_PATH, 0, winreg.KEY_WRITE)
|
168
|
+
winreg.DeleteValue(key, APP_NAME)
|
169
|
+
winreg.CloseKey(key)
|
170
|
+
print(f"Success: Registry key HKLM\{REG_PATH}\{APP_NAME} removed.")
|
171
|
+
except FileNotFoundError:
|
172
|
+
print(f"Info: Registry key HKLM\{REG_PATH}\{APP_NAME} not found. No action taken.")
|
173
|
+
except OSError as e:
|
174
|
+
print(f"Error: Failed to delete registry key HKLM\{REG_PATH}\{APP_NAME}", file=sys.stderr)
|
175
|
+
print(f"Details: {e}", file=sys.stderr)
|
176
|
+
# Continue to task removal
|
177
|
+
except Exception as e:
|
178
|
+
print(f"An unexpected error occurred removing registry key: {e}", file=sys.stderr)
|
179
|
+
# Continue to task removal
|
180
|
+
|
181
|
+
# 2. Remove Scheduled Task
|
182
|
+
print(f"\nRemoving scheduled task '{TASK_NAME}'...")
|
183
|
+
# Use -ErrorAction SilentlyContinue for Unregister-ScheduledTask if it might not exist
|
184
|
+
# Use triple-double quotes for f-string
|
185
|
+
unregister_command = f"""Unregister-ScheduledTask -TaskName '{TASK_NAME}' -Confirm:$false -ErrorAction SilentlyContinue"""
|
186
|
+
|
187
|
+
if run_powershell_command(unregister_command):
|
188
|
+
print(f"Success: Scheduled task '{TASK_NAME}' removed (if it existed).")
|
189
|
+
else:
|
190
|
+
print(f"Error: Failed to remove scheduled task '{TASK_NAME}'. Please check PowerShell errors above.", file=sys.stderr)
|
191
|
+
|
192
|
+
if __name__ == '__main__':
|
193
|
+
print("This script provides startup and auto-update configuration utilities.")
|
194
|
+
print("Use 'ootb-configure-startup' or 'ootb-remove-startup' as Administrator after installation.")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: computer-use-ootb-internal
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.110
|
4
4
|
Summary: Computer Use OOTB
|
5
5
|
Author-email: Siyuan Hu <siyuan.hu.sg@gmail.com>
|
6
6
|
Requires-Python: >=3.11
|
@@ -14,15 +14,14 @@ Requires-Dist: matplotlib
|
|
14
14
|
Requires-Dist: opencv-python
|
15
15
|
Requires-Dist: pre-commit==3.8.0
|
16
16
|
Requires-Dist: pyautogui==0.9.54
|
17
|
-
Requires-Dist: pyside6
|
18
17
|
Requires-Dist: pytest-asyncio==0.23.6
|
19
18
|
Requires-Dist: pytest==8.3.3
|
20
|
-
Requires-Dist: pywinauto
|
19
|
+
Requires-Dist: pywinauto; sys_platform == 'win32'
|
21
20
|
Requires-Dist: ruff==0.6.7
|
22
21
|
Requires-Dist: screeninfo
|
23
22
|
Requires-Dist: streamlit>=1.38.0
|
24
23
|
Requires-Dist: textdistance
|
25
|
-
Requires-Dist: uiautomation
|
24
|
+
Requires-Dist: uiautomation; sys_platform == 'win32'
|
26
25
|
Provides-Extra: dev
|
27
26
|
Requires-Dist: pytest-asyncio>=0.23.6; extra == 'dev'
|
28
27
|
Requires-Dist: pytest>=8.3.3; extra == 'dev'
|
@@ -1,13 +1,15 @@
|
|
1
1
|
computer_use_ootb_internal/README.md,sha256=FxpW95lyub2iX73ZDfK6ML7SdEKg060H5I6Grub7li4,31
|
2
|
-
computer_use_ootb_internal/
|
2
|
+
computer_use_ootb_internal/__init__.py,sha256=Nqnn8clbgv-5l0PgxcTOldg8mkMKrFn4TvPL-rYUUGg,1
|
3
|
+
computer_use_ootb_internal/app_teachmode.py,sha256=-PQVCIi-6mkJ8vbyEenTPnCDYgu7R33ci_kFY7Ccfbw,18771
|
3
4
|
computer_use_ootb_internal/app_teachmode_gradio.py,sha256=cmFpBrkdlZxOQADWveVdIaaNqaBD8IVs-xNLJogU7F8,7909
|
4
5
|
computer_use_ootb_internal/dependency_check.py,sha256=y8RMEP6RXQzTgU1MS_1piBLtz4J-Hfn9RjUZg59dyvo,1333
|
5
6
|
computer_use_ootb_internal/requirements-lite.txt,sha256=5DAHomz4A_P2BmTIXNkNqkHbnIF0AyZ4_1XAlb1LaYs,290
|
6
7
|
computer_use_ootb_internal/run_teachmode_ootb_args.py,sha256=7Dj0iY4GG7P03tRKYJ2x9Yvt-PE-b7uyjCAed3SaF3Y,7086
|
8
|
+
computer_use_ootb_internal/startup_utils.py,sha256=JXu_13YuVdCUVJHgLoSyQV-tHy7qGEYgyPOyVgoxva4,9334
|
7
9
|
computer_use_ootb_internal/computer_use_demo/animation/click_animation.py,sha256=tP1gsayFy-CKk10UlrE9RlexwlHWiHQUe5Ogg4vQvSg,3234
|
8
10
|
computer_use_ootb_internal/computer_use_demo/animation/icons8-select-cursor-transparent-96.gif,sha256=4LfwsfFQnREXrNRs32aJU2jO65JXianJoL_8q7-8elg,30966
|
9
|
-
computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=
|
10
|
-
computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py,sha256=
|
11
|
+
computer_use_ootb_internal/computer_use_demo/animation/test_animation.py,sha256=2R1u98OLKYalSZ5nt5vvyZ71FL5R5vLv-n8zM8jVdV8,1183
|
12
|
+
computer_use_ootb_internal/computer_use_demo/executor/teachmode_executor.py,sha256=TBp_rXSAuHFBmZYyyIFca404c4v5LG1ZVbNaQpuvtzQ,16656
|
11
13
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/__init__.py,sha256=h2CNeuACklxVpJC65QR8_6AvSybEZLmeO45hY_-lLBs,61
|
12
14
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/gui_capture.py,sha256=CxFJbsSb68ERKH7-C4RaaZy7FIhhzrzGx5qQJ4C37cA,13907
|
13
15
|
computer_use_ootb_internal/computer_use_demo/gui_agent/gui_parser/simple_parser/utils.py,sha256=OOVxy4Qlbk5q-X9kXFXqt6AmuOMl6FWWqtH269DvJJA,10005
|
@@ -18,20 +20,18 @@ computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/llm_utils.py,sh
|
|
18
20
|
computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/oai.py,sha256=zWAHa37fhIWCYpIEvQsIe5prfBJQ9yZFQwAi_dm8baE,4158
|
19
21
|
computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_litellm.py,sha256=SBnWMhwZoCFji9-ii7VSfPYAhDKUWvlJgJzw9-Ei3-g,7750
|
20
22
|
computer_use_ootb_internal/computer_use_demo/gui_agent/llm_utils/run_llm.py,sha256=fxC-7lg8TLAi9f69zs5y5Pwga8Y5mY7Yfc5NNZNRJgM,1558
|
21
|
-
computer_use_ootb_internal/computer_use_demo/gui_agent/vlm_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
-
computer_use_ootb_internal/computer_use_demo/gui_agent/vlm_utils/run_vlm.py,sha256=9IaX15dhFFOALr0vcsI-EtEU4pDLfdzlmwCy3HRbISA,1441
|
23
23
|
computer_use_ootb_internal/computer_use_demo/tools/__init__.py,sha256=Pj8_5L4_PPQK298X4NV3KMbP-84t-bM0pbjEeb5_SJQ,343
|
24
24
|
computer_use_ootb_internal/computer_use_demo/tools/aws_request.py,sha256=12UVzeA2PmpZhpy2Pt5Vh48-_q1e8ZjVQux6r3pbAcw,2629
|
25
25
|
computer_use_ootb_internal/computer_use_demo/tools/base.py,sha256=4HHSxDg6GsCoraamWor75ZnoR7tAcRarMv4MzvqMWGU,2099
|
26
26
|
computer_use_ootb_internal/computer_use_demo/tools/bash.py,sha256=rHetQ80_v-TTi-1oxIA7ncFEwJxFTh8FJCErIoZbGeY,4236
|
27
27
|
computer_use_ootb_internal/computer_use_demo/tools/collection.py,sha256=8RzHLobL44_Jjt8ltXS6I8XJlEAQOfc75dmnDUaHE-8,922
|
28
28
|
computer_use_ootb_internal/computer_use_demo/tools/colorful_text.py,sha256=cvlmnhAImDTwoRRwhT5au7mNFhfAD7ZfeoDEVdVzDKw,892
|
29
|
-
computer_use_ootb_internal/computer_use_demo/tools/computer.py,sha256=
|
29
|
+
computer_use_ootb_internal/computer_use_demo/tools/computer.py,sha256=lm3bzh-ZzeFGAqrgQGkDr6SnvoB9d4NvVo8D1PNOoAk,26745
|
30
30
|
computer_use_ootb_internal/computer_use_demo/tools/computer_marbot.py,sha256=zZuWz9ArfP3Zss-afnscrPkgCtB5UWbCy7HwAOvO2bo,5970
|
31
31
|
computer_use_ootb_internal/computer_use_demo/tools/edit.py,sha256=b0PwUitxckHCQqFP3ZwlthWdqNkn7WETeTHeB6-o98c,11486
|
32
32
|
computer_use_ootb_internal/computer_use_demo/tools/run.py,sha256=xhXdnBK1di9muaO44CEirL9hpGy3NmKbjfMpyeVmn8Y,1595
|
33
33
|
computer_use_ootb_internal/computer_use_demo/tools/screen_capture.py,sha256=L8qfvtUkPPQGt92N-2Zfw5ZTDBzLsDps39uMnX3_uSA,6857
|
34
|
-
computer_use_ootb_internal-0.0.
|
35
|
-
computer_use_ootb_internal-0.0.
|
36
|
-
computer_use_ootb_internal-0.0.
|
37
|
-
computer_use_ootb_internal-0.0.
|
34
|
+
computer_use_ootb_internal-0.0.110.dist-info/METADATA,sha256=VApESAleeSZz-CoNCaWHkEC9WFHl-Nb5qfa6MUC3bIw,937
|
35
|
+
computer_use_ootb_internal-0.0.110.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
36
|
+
computer_use_ootb_internal-0.0.110.dist-info/entry_points.txt,sha256=XOxhaseEddM9LaMoWFupcavxn5jMU7kMrLyrmcfc_bQ,255
|
37
|
+
computer_use_ootb_internal-0.0.110.dist-info/RECORD,,
|
File without changes
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import base64
|
2
|
-
import logging
|
3
|
-
|
4
|
-
|
5
|
-
def run_vlm(messages, system, vlm="gpt-4o-mini", max_tokens=512, temperature=0, stop=None):
|
6
|
-
log_prompt(messages)
|
7
|
-
|
8
|
-
# turn string prompt into list
|
9
|
-
if isinstance(messages, str):
|
10
|
-
messages = [messages]
|
11
|
-
elif isinstance(messages, list):
|
12
|
-
pass
|
13
|
-
else:
|
14
|
-
raise ValueError(f"Invalid prompt type: {type(messages)}")
|
15
|
-
|
16
|
-
if vlm.startswith("gpt"): # gpt series
|
17
|
-
from .oai import run_oai_interleaved
|
18
|
-
response, token_usage = run_oai_interleaved(
|
19
|
-
messages=messages,
|
20
|
-
system=system,
|
21
|
-
llm=llm,
|
22
|
-
max_tokens=max_tokens,
|
23
|
-
temperature=temperature
|
24
|
-
)
|
25
|
-
elif vlm.startswith("gemini"): # gemini series
|
26
|
-
from .gemini import run_gemini_interleaved
|
27
|
-
|
28
|
-
response, token_usage = run_gemini_interleaved(
|
29
|
-
messages=messages,
|
30
|
-
system=system,
|
31
|
-
vlm=vlm,
|
32
|
-
max_tokens=max_tokens,
|
33
|
-
temperature=temperature
|
34
|
-
)
|
35
|
-
else:
|
36
|
-
raise ValueError(f"Invalid llm: {llm}")
|
37
|
-
logging.info(
|
38
|
-
f"========Output for {vlm}=======\n{response}\n============================")
|
39
|
-
return response
|
40
|
-
|
41
|
-
def log_prompt(prompt):
|
42
|
-
prompt_display = [prompt] if isinstance(prompt, str) else prompt
|
43
|
-
prompt_display = "\n\n".join(prompt_display)
|
44
|
-
logging.info(
|
45
|
-
f"========Prompt=======\n{prompt_display}\n============================")
|
46
|
-
|
File without changes
|