cua-agent 0.4.6__tar.gz → 0.4.7__tar.gz
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.
Potentially problematic release.
This version of cua-agent might be problematic. Click here for more details.
- {cua_agent-0.4.6 → cua_agent-0.4.7}/PKG-INFO +2 -2
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/adapters/huggingfacelocal_adapter.py +3 -4
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/agent.py +3 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/ui/gradio/app.py +14 -7
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/ui/gradio/ui_components.py +18 -1
- {cua_agent-0.4.6 → cua_agent-0.4.7}/pyproject.toml +2 -2
- {cua_agent-0.4.6 → cua_agent-0.4.7}/README.md +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/__init__.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/__main__.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/adapters/__init__.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/callbacks/__init__.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/callbacks/base.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/callbacks/budget_manager.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/callbacks/image_retention.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/callbacks/logging.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/callbacks/pii_anonymization.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/callbacks/telemetry.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/callbacks/trajectory_saver.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/cli.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/computer_handler.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/decorators.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/loops/__init__.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/loops/anthropic.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/loops/omniparser.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/loops/openai.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/loops/uitars.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/responses.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/telemetry.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/types.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/ui/__init__.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/ui/__main__.py +0 -0
- {cua_agent-0.4.6 → cua_agent-0.4.7}/agent/ui/gradio/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cua-agent
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: CUA (Computer Use) Agent for AI-driven computer interaction
|
|
5
5
|
Author-Email: TryCua <gh@trycua.com>
|
|
6
6
|
Requires-Python: >=3.11
|
|
@@ -12,7 +12,7 @@ Requires-Dist: typing-extensions>=4.12.2
|
|
|
12
12
|
Requires-Dist: pydantic>=2.6.4
|
|
13
13
|
Requires-Dist: rich>=13.7.1
|
|
14
14
|
Requires-Dist: python-dotenv>=1.0.1
|
|
15
|
-
Requires-Dist: cua-computer<0.5.0,>=0.
|
|
15
|
+
Requires-Dist: cua-computer<0.5.0,>=0.4.0
|
|
16
16
|
Requires-Dist: cua-core<0.2.0,>=0.1.8
|
|
17
17
|
Requires-Dist: certifi>=2024.2.2
|
|
18
18
|
Requires-Dist: litellm>=1.74.8
|
|
@@ -8,7 +8,7 @@ from litellm import completion, acompletion
|
|
|
8
8
|
# Try to import HuggingFace dependencies
|
|
9
9
|
try:
|
|
10
10
|
import torch
|
|
11
|
-
from transformers import
|
|
11
|
+
from transformers import AutoModelForImageTextToText, AutoProcessor
|
|
12
12
|
HF_AVAILABLE = True
|
|
13
13
|
except ImportError:
|
|
14
14
|
HF_AVAILABLE = False
|
|
@@ -40,7 +40,7 @@ class HuggingFaceLocalAdapter(CustomLLM):
|
|
|
40
40
|
"""
|
|
41
41
|
if model_name not in self.models:
|
|
42
42
|
# Load model
|
|
43
|
-
model =
|
|
43
|
+
model = AutoModelForImageTextToText.from_pretrained(
|
|
44
44
|
model_name,
|
|
45
45
|
torch_dtype=torch.float16,
|
|
46
46
|
device_map=self.device,
|
|
@@ -141,8 +141,7 @@ class HuggingFaceLocalAdapter(CustomLLM):
|
|
|
141
141
|
)
|
|
142
142
|
|
|
143
143
|
# Move inputs to the same device as model
|
|
144
|
-
|
|
145
|
-
inputs = inputs.to("cuda")
|
|
144
|
+
inputs = inputs.to(model.device)
|
|
146
145
|
|
|
147
146
|
# Generate response
|
|
148
147
|
with torch.no_grad():
|
|
@@ -411,6 +411,9 @@ class ComputerAgent:
|
|
|
411
411
|
# Perform computer actions
|
|
412
412
|
action = item.get("action")
|
|
413
413
|
action_type = action.get("type")
|
|
414
|
+
if action_type is None:
|
|
415
|
+
print(f"Action type cannot be `None`: action={action}, action_type={action_type}")
|
|
416
|
+
return []
|
|
414
417
|
|
|
415
418
|
# Extract action arguments (all fields except 'type')
|
|
416
419
|
action_args = {k: v for k, v in action.items() if k != "type"}
|
|
@@ -178,13 +178,20 @@ def create_computer_instance(
|
|
|
178
178
|
"""Create or get the global Computer instance."""
|
|
179
179
|
global global_computer
|
|
180
180
|
if global_computer is None:
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
181
|
+
if provider_type == "localhost":
|
|
182
|
+
global_computer = Computer(
|
|
183
|
+
verbosity=verbosity,
|
|
184
|
+
os_type=os_type,
|
|
185
|
+
use_host_computer_server=True
|
|
186
|
+
)
|
|
187
|
+
else:
|
|
188
|
+
global_computer = Computer(
|
|
189
|
+
verbosity=verbosity,
|
|
190
|
+
os_type=os_type,
|
|
191
|
+
provider_type=provider_type,
|
|
192
|
+
name=name if name else "",
|
|
193
|
+
api_key=api_key
|
|
194
|
+
)
|
|
188
195
|
return global_computer
|
|
189
196
|
|
|
190
197
|
|
|
@@ -211,7 +211,7 @@ if __name__ == "__main__":
|
|
|
211
211
|
is_windows = platform.system().lower() == "windows"
|
|
212
212
|
is_mac = platform.system().lower() == "darwin"
|
|
213
213
|
|
|
214
|
-
providers = ["cloud"]
|
|
214
|
+
providers = ["cloud", "localhost"]
|
|
215
215
|
if is_mac:
|
|
216
216
|
providers += ["lume"]
|
|
217
217
|
if is_windows:
|
|
@@ -403,6 +403,23 @@ if __name__ == "__main__":
|
|
|
403
403
|
type="password",
|
|
404
404
|
)
|
|
405
405
|
|
|
406
|
+
# Provider visibility update function
|
|
407
|
+
def update_provider_visibility(provider):
|
|
408
|
+
"""Update visibility of container name and API key based on selected provider."""
|
|
409
|
+
is_localhost = provider == "localhost"
|
|
410
|
+
return [
|
|
411
|
+
gr.update(visible=not is_localhost), # container_name
|
|
412
|
+
gr.update(visible=not is_localhost and not has_cua_key) # cua_cloud_api_key
|
|
413
|
+
]
|
|
414
|
+
|
|
415
|
+
# Connect provider change event
|
|
416
|
+
computer_provider.change(
|
|
417
|
+
fn=update_provider_visibility,
|
|
418
|
+
inputs=[computer_provider],
|
|
419
|
+
outputs=[container_name, cua_cloud_api_key],
|
|
420
|
+
queue=False
|
|
421
|
+
)
|
|
422
|
+
|
|
406
423
|
# Connect UI update events
|
|
407
424
|
for dropdown in [agent_loop, omni_model_choice, uitars_model_choice, openai_model_choice, anthropic_model_choice]:
|
|
408
425
|
dropdown.change(
|
|
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "cua-agent"
|
|
9
|
-
version = "0.4.
|
|
9
|
+
version = "0.4.7"
|
|
10
10
|
description = "CUA (Computer Use) Agent for AI-driven computer interaction"
|
|
11
11
|
readme = "README.md"
|
|
12
12
|
authors = [
|
|
@@ -21,7 +21,7 @@ dependencies = [
|
|
|
21
21
|
"pydantic>=2.6.4",
|
|
22
22
|
"rich>=13.7.1",
|
|
23
23
|
"python-dotenv>=1.0.1",
|
|
24
|
-
"cua-computer>=0.
|
|
24
|
+
"cua-computer>=0.4.0,<0.5.0",
|
|
25
25
|
"cua-core>=0.1.8,<0.2.0",
|
|
26
26
|
"certifi>=2024.2.2",
|
|
27
27
|
"litellm>=1.74.8",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|