cua-agent 0.3.1__py3-none-any.whl → 0.4.0__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.
Potentially problematic release.
This version of cua-agent might be problematic. Click here for more details.
- agent/__init__.py +21 -12
- agent/__main__.py +21 -0
- agent/adapters/__init__.py +9 -0
- agent/adapters/huggingfacelocal_adapter.py +229 -0
- agent/agent.py +594 -0
- agent/callbacks/__init__.py +19 -0
- agent/callbacks/base.py +153 -0
- agent/callbacks/budget_manager.py +44 -0
- agent/callbacks/image_retention.py +139 -0
- agent/callbacks/logging.py +247 -0
- agent/callbacks/pii_anonymization.py +259 -0
- agent/callbacks/telemetry.py +210 -0
- agent/callbacks/trajectory_saver.py +305 -0
- agent/cli.py +297 -0
- agent/computer_handler.py +107 -0
- agent/decorators.py +90 -0
- agent/loops/__init__.py +11 -0
- agent/loops/anthropic.py +728 -0
- agent/loops/omniparser.py +339 -0
- agent/loops/openai.py +95 -0
- agent/loops/uitars.py +688 -0
- agent/responses.py +207 -0
- agent/telemetry.py +135 -14
- agent/types.py +79 -0
- agent/ui/__init__.py +7 -1
- agent/ui/__main__.py +2 -13
- agent/ui/gradio/__init__.py +6 -19
- agent/ui/gradio/app.py +94 -1313
- agent/ui/gradio/ui_components.py +721 -0
- cua_agent-0.4.0.dist-info/METADATA +424 -0
- cua_agent-0.4.0.dist-info/RECORD +33 -0
- {cua_agent-0.3.1.dist-info → cua_agent-0.4.0.dist-info}/WHEEL +1 -1
- agent/core/__init__.py +0 -27
- agent/core/agent.py +0 -210
- agent/core/base.py +0 -217
- agent/core/callbacks.py +0 -200
- agent/core/experiment.py +0 -249
- agent/core/factory.py +0 -122
- agent/core/messages.py +0 -332
- agent/core/provider_config.py +0 -21
- agent/core/telemetry.py +0 -142
- agent/core/tools/__init__.py +0 -21
- agent/core/tools/base.py +0 -74
- agent/core/tools/bash.py +0 -52
- agent/core/tools/collection.py +0 -46
- agent/core/tools/computer.py +0 -113
- agent/core/tools/edit.py +0 -67
- agent/core/tools/manager.py +0 -56
- agent/core/tools.py +0 -32
- agent/core/types.py +0 -88
- agent/core/visualization.py +0 -197
- agent/providers/__init__.py +0 -4
- agent/providers/anthropic/__init__.py +0 -6
- agent/providers/anthropic/api/client.py +0 -360
- agent/providers/anthropic/api/logging.py +0 -150
- agent/providers/anthropic/api_handler.py +0 -140
- agent/providers/anthropic/callbacks/__init__.py +0 -5
- agent/providers/anthropic/callbacks/manager.py +0 -65
- agent/providers/anthropic/loop.py +0 -568
- agent/providers/anthropic/prompts.py +0 -23
- agent/providers/anthropic/response_handler.py +0 -226
- agent/providers/anthropic/tools/__init__.py +0 -33
- agent/providers/anthropic/tools/base.py +0 -88
- agent/providers/anthropic/tools/bash.py +0 -66
- agent/providers/anthropic/tools/collection.py +0 -34
- agent/providers/anthropic/tools/computer.py +0 -396
- agent/providers/anthropic/tools/edit.py +0 -326
- agent/providers/anthropic/tools/manager.py +0 -54
- agent/providers/anthropic/tools/run.py +0 -42
- agent/providers/anthropic/types.py +0 -16
- agent/providers/anthropic/utils.py +0 -367
- agent/providers/omni/__init__.py +0 -8
- agent/providers/omni/api_handler.py +0 -42
- agent/providers/omni/clients/anthropic.py +0 -103
- agent/providers/omni/clients/base.py +0 -35
- agent/providers/omni/clients/oaicompat.py +0 -195
- agent/providers/omni/clients/ollama.py +0 -122
- agent/providers/omni/clients/openai.py +0 -155
- agent/providers/omni/clients/utils.py +0 -25
- agent/providers/omni/image_utils.py +0 -34
- agent/providers/omni/loop.py +0 -990
- agent/providers/omni/parser.py +0 -307
- agent/providers/omni/prompts.py +0 -64
- agent/providers/omni/tools/__init__.py +0 -30
- agent/providers/omni/tools/base.py +0 -29
- agent/providers/omni/tools/bash.py +0 -74
- agent/providers/omni/tools/computer.py +0 -179
- agent/providers/omni/tools/manager.py +0 -61
- agent/providers/omni/utils.py +0 -236
- agent/providers/openai/__init__.py +0 -6
- agent/providers/openai/api_handler.py +0 -456
- agent/providers/openai/loop.py +0 -472
- agent/providers/openai/response_handler.py +0 -205
- agent/providers/openai/tools/__init__.py +0 -15
- agent/providers/openai/tools/base.py +0 -79
- agent/providers/openai/tools/computer.py +0 -326
- agent/providers/openai/tools/manager.py +0 -106
- agent/providers/openai/types.py +0 -36
- agent/providers/openai/utils.py +0 -98
- agent/providers/uitars/__init__.py +0 -1
- agent/providers/uitars/clients/base.py +0 -35
- agent/providers/uitars/clients/mlxvlm.py +0 -263
- agent/providers/uitars/clients/oaicompat.py +0 -214
- agent/providers/uitars/loop.py +0 -660
- agent/providers/uitars/prompts.py +0 -63
- agent/providers/uitars/tools/__init__.py +0 -1
- agent/providers/uitars/tools/computer.py +0 -283
- agent/providers/uitars/tools/manager.py +0 -60
- agent/providers/uitars/utils.py +0 -264
- cua_agent-0.3.1.dist-info/METADATA +0 -295
- cua_agent-0.3.1.dist-info/RECORD +0 -87
- {cua_agent-0.3.1.dist-info → cua_agent-0.4.0.dist-info}/entry_points.txt +0 -0
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: cua-agent
|
|
3
|
-
Version: 0.3.1
|
|
4
|
-
Summary: CUA (Computer Use) Agent for AI-driven computer interaction
|
|
5
|
-
Author-Email: TryCua <gh@trycua.com>
|
|
6
|
-
Requires-Python: >=3.11
|
|
7
|
-
Requires-Dist: httpx>=0.27.0
|
|
8
|
-
Requires-Dist: aiohttp>=3.9.3
|
|
9
|
-
Requires-Dist: asyncio
|
|
10
|
-
Requires-Dist: anyio>=4.4.1
|
|
11
|
-
Requires-Dist: typing-extensions>=4.12.2
|
|
12
|
-
Requires-Dist: pydantic>=2.6.4
|
|
13
|
-
Requires-Dist: rich>=13.7.1
|
|
14
|
-
Requires-Dist: python-dotenv>=1.0.1
|
|
15
|
-
Requires-Dist: cua-computer<0.4.0,>=0.3.0
|
|
16
|
-
Requires-Dist: cua-core<0.2.0,>=0.1.0
|
|
17
|
-
Requires-Dist: certifi>=2024.2.2
|
|
18
|
-
Provides-Extra: anthropic
|
|
19
|
-
Requires-Dist: anthropic>=0.49.0; extra == "anthropic"
|
|
20
|
-
Requires-Dist: boto3>=1.35.81; extra == "anthropic"
|
|
21
|
-
Provides-Extra: openai
|
|
22
|
-
Requires-Dist: openai>=1.14.0; extra == "openai"
|
|
23
|
-
Requires-Dist: httpx>=0.27.0; extra == "openai"
|
|
24
|
-
Provides-Extra: uitars
|
|
25
|
-
Requires-Dist: httpx>=0.27.0; extra == "uitars"
|
|
26
|
-
Provides-Extra: uitars-mlx
|
|
27
|
-
Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "uitars-mlx"
|
|
28
|
-
Provides-Extra: ui
|
|
29
|
-
Requires-Dist: gradio>=5.23.3; extra == "ui"
|
|
30
|
-
Requires-Dist: python-dotenv>=1.0.1; extra == "ui"
|
|
31
|
-
Provides-Extra: som
|
|
32
|
-
Requires-Dist: torch>=2.2.1; extra == "som"
|
|
33
|
-
Requires-Dist: torchvision>=0.17.1; extra == "som"
|
|
34
|
-
Requires-Dist: ultralytics>=8.0.0; extra == "som"
|
|
35
|
-
Requires-Dist: transformers>=4.38.2; extra == "som"
|
|
36
|
-
Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "som"
|
|
37
|
-
Requires-Dist: anthropic>=0.46.0; extra == "som"
|
|
38
|
-
Requires-Dist: boto3>=1.35.81; extra == "som"
|
|
39
|
-
Requires-Dist: openai>=1.14.0; extra == "som"
|
|
40
|
-
Requires-Dist: groq>=0.4.0; extra == "som"
|
|
41
|
-
Requires-Dist: dashscope>=1.13.0; extra == "som"
|
|
42
|
-
Requires-Dist: requests>=2.31.0; extra == "som"
|
|
43
|
-
Provides-Extra: omni
|
|
44
|
-
Requires-Dist: torch>=2.2.1; extra == "omni"
|
|
45
|
-
Requires-Dist: torchvision>=0.17.1; extra == "omni"
|
|
46
|
-
Requires-Dist: ultralytics>=8.0.0; extra == "omni"
|
|
47
|
-
Requires-Dist: transformers>=4.38.2; extra == "omni"
|
|
48
|
-
Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "omni"
|
|
49
|
-
Requires-Dist: anthropic>=0.46.0; extra == "omni"
|
|
50
|
-
Requires-Dist: boto3>=1.35.81; extra == "omni"
|
|
51
|
-
Requires-Dist: openai>=1.14.0; extra == "omni"
|
|
52
|
-
Requires-Dist: groq>=0.4.0; extra == "omni"
|
|
53
|
-
Requires-Dist: dashscope>=1.13.0; extra == "omni"
|
|
54
|
-
Requires-Dist: requests>=2.31.0; extra == "omni"
|
|
55
|
-
Requires-Dist: ollama>=0.4.7; extra == "omni"
|
|
56
|
-
Provides-Extra: all
|
|
57
|
-
Requires-Dist: torch>=2.2.1; extra == "all"
|
|
58
|
-
Requires-Dist: torchvision>=0.17.1; extra == "all"
|
|
59
|
-
Requires-Dist: ultralytics>=8.0.0; extra == "all"
|
|
60
|
-
Requires-Dist: transformers>=4.38.2; extra == "all"
|
|
61
|
-
Requires-Dist: cua-som<0.2.0,>=0.1.0; extra == "all"
|
|
62
|
-
Requires-Dist: anthropic>=0.46.0; extra == "all"
|
|
63
|
-
Requires-Dist: boto3>=1.35.81; extra == "all"
|
|
64
|
-
Requires-Dist: openai>=1.14.0; extra == "all"
|
|
65
|
-
Requires-Dist: groq>=0.4.0; extra == "all"
|
|
66
|
-
Requires-Dist: dashscope>=1.13.0; extra == "all"
|
|
67
|
-
Requires-Dist: requests>=2.31.0; extra == "all"
|
|
68
|
-
Requires-Dist: ollama>=0.4.7; extra == "all"
|
|
69
|
-
Requires-Dist: gradio>=5.23.3; extra == "all"
|
|
70
|
-
Requires-Dist: python-dotenv>=1.0.1; extra == "all"
|
|
71
|
-
Requires-Dist: mlx-vlm>=0.1.27; sys_platform == "darwin" and extra == "all"
|
|
72
|
-
Description-Content-Type: text/markdown
|
|
73
|
-
|
|
74
|
-
<div align="center">
|
|
75
|
-
<h1>
|
|
76
|
-
<div class="image-wrapper" style="display: inline-block;">
|
|
77
|
-
<picture>
|
|
78
|
-
<source media="(prefers-color-scheme: dark)" alt="logo" height="150" srcset="../../img/logo_white.png" style="display: block; margin: auto;">
|
|
79
|
-
<source media="(prefers-color-scheme: light)" alt="logo" height="150" srcset="../../img/logo_black.png" style="display: block; margin: auto;">
|
|
80
|
-
<img alt="Shows my svg">
|
|
81
|
-
</picture>
|
|
82
|
-
</div>
|
|
83
|
-
|
|
84
|
-
[](#)
|
|
85
|
-
[](#)
|
|
86
|
-
[](https://discord.com/invite/mVnXXpdE85)
|
|
87
|
-
[](https://pypi.org/project/cua-computer/)
|
|
88
|
-
</h1>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
**cua-agent** is a general Computer-Use framework for running multi-app agentic workflows targeting macOS and Linux sandbox created with Cua, supporting local (Ollama) and cloud model providers (OpenAI, Anthropic, Groq, DeepSeek, Qwen).
|
|
92
|
-
|
|
93
|
-
### Get started with Agent
|
|
94
|
-
|
|
95
|
-
<div align="center">
|
|
96
|
-
<img src="../../img/agent.png"/>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
## Install
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
pip install "cua-agent[all]"
|
|
103
|
-
|
|
104
|
-
# or install specific loop providers
|
|
105
|
-
pip install "cua-agent[openai]" # OpenAI Cua Loop
|
|
106
|
-
pip install "cua-agent[anthropic]" # Anthropic Cua Loop
|
|
107
|
-
pip install "cua-agent[uitars]" # UI-Tars support
|
|
108
|
-
pip install "cua-agent[omni]" # Cua Loop based on OmniParser (includes Ollama for local models)
|
|
109
|
-
pip install "cua-agent[ui]" # Gradio UI for the agent
|
|
110
|
-
pip install "cua-agent[uitars-mlx]" # MLX UI-Tars support
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Run
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
async with Computer() as macos_computer:
|
|
117
|
-
# Create agent with loop and provider
|
|
118
|
-
agent = ComputerAgent(
|
|
119
|
-
computer=macos_computer,
|
|
120
|
-
loop=AgentLoop.OPENAI,
|
|
121
|
-
model=LLM(provider=LLMProvider.OPENAI)
|
|
122
|
-
# or
|
|
123
|
-
# loop=AgentLoop.ANTHROPIC,
|
|
124
|
-
# model=LLM(provider=LLMProvider.ANTHROPIC)
|
|
125
|
-
# or
|
|
126
|
-
# loop=AgentLoop.OMNI,
|
|
127
|
-
# model=LLM(provider=LLMProvider.OLLAMA, name="gemma3")
|
|
128
|
-
# or
|
|
129
|
-
# loop=AgentLoop.UITARS,
|
|
130
|
-
# model=LLM(provider=LLMProvider.OAICOMPAT, name="ByteDance-Seed/UI-TARS-1.5-7B", provider_base_url="https://**************.us-east-1.aws.endpoints.huggingface.cloud/v1")
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
tasks = [
|
|
134
|
-
"Look for a repository named trycua/cua on GitHub.",
|
|
135
|
-
"Check the open issues, open the most recent one and read it.",
|
|
136
|
-
"Clone the repository in users/lume/projects if it doesn't exist yet.",
|
|
137
|
-
"Open the repository with an app named Cursor (on the dock, black background and white cube icon).",
|
|
138
|
-
"From Cursor, open Composer if not already open.",
|
|
139
|
-
"Focus on the Composer text area, then write and submit a task to help resolve the GitHub issue.",
|
|
140
|
-
]
|
|
141
|
-
|
|
142
|
-
for i, task in enumerate(tasks):
|
|
143
|
-
print(f"\nExecuting task {i}/{len(tasks)}: {task}")
|
|
144
|
-
async for result in agent.run(task):
|
|
145
|
-
print(result)
|
|
146
|
-
|
|
147
|
-
print(f"\n✅ Task {i+1}/{len(tasks)} completed: {task}")
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Refer to these notebooks for step-by-step guides on how to use the Computer-Use Agent (CUA):
|
|
151
|
-
|
|
152
|
-
- [Agent Notebook](../../notebooks/agent_nb.ipynb) - Complete examples and workflows
|
|
153
|
-
|
|
154
|
-
## Using the Gradio UI
|
|
155
|
-
|
|
156
|
-
The agent includes a Gradio-based user interface for easier interaction.
|
|
157
|
-
|
|
158
|
-
<div align="center">
|
|
159
|
-
<img src="../../img/agent_gradio_ui.png"/>
|
|
160
|
-
</div>
|
|
161
|
-
|
|
162
|
-
To use it:
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
# Install with Gradio support
|
|
166
|
-
pip install "cua-agent[ui]"
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Create a simple launcher script
|
|
170
|
-
|
|
171
|
-
```python
|
|
172
|
-
# launch_ui.py
|
|
173
|
-
from agent.ui.gradio.app import create_gradio_ui
|
|
174
|
-
|
|
175
|
-
app = create_gradio_ui()
|
|
176
|
-
app.launch(share=False)
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### Setting up API Keys
|
|
180
|
-
|
|
181
|
-
For the Gradio UI to show available models, you need to set API keys as environment variables:
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
# For OpenAI models
|
|
185
|
-
export OPENAI_API_KEY=your_openai_key_here
|
|
186
|
-
|
|
187
|
-
# For Anthropic models
|
|
188
|
-
export ANTHROPIC_API_KEY=your_anthropic_key_here
|
|
189
|
-
|
|
190
|
-
# Launch with both keys set
|
|
191
|
-
OPENAI_API_KEY=your_key ANTHROPIC_API_KEY=your_key python launch_ui.py
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
Without these environment variables, the UI will show "No models available" for the corresponding providers, but you can still use local models with the OMNI loop provider.
|
|
195
|
-
|
|
196
|
-
### Using Local Models
|
|
197
|
-
|
|
198
|
-
You can use local models with the OMNI loop provider by selecting "Custom model..." from the dropdown. The default provider URL is set to `http://localhost:1234/v1` which works with LM Studio.
|
|
199
|
-
|
|
200
|
-
If you're using a different local model server:
|
|
201
|
-
- vLLM: `http://localhost:8000/v1`
|
|
202
|
-
- LocalAI: `http://localhost:8080/v1`
|
|
203
|
-
- Ollama with OpenAI compat API: `http://localhost:11434/v1`
|
|
204
|
-
|
|
205
|
-
The Gradio UI provides:
|
|
206
|
-
- Selection of different agent loops (OpenAI, Anthropic, OMNI)
|
|
207
|
-
- Model selection for each provider
|
|
208
|
-
- Configuration of agent parameters
|
|
209
|
-
- Chat interface for interacting with the agent
|
|
210
|
-
|
|
211
|
-
### Using UI-TARS
|
|
212
|
-
|
|
213
|
-
The UI-TARS models are available in two forms:
|
|
214
|
-
|
|
215
|
-
1. **MLX UI-TARS models** (Default): These models run locally using MLXVLM provider
|
|
216
|
-
- `mlx-community/UI-TARS-1.5-7B-4bit` (default) - 4-bit quantized version
|
|
217
|
-
- `mlx-community/UI-TARS-1.5-7B-6bit` - 6-bit quantized version for higher quality
|
|
218
|
-
|
|
219
|
-
```python
|
|
220
|
-
agent = ComputerAgent(
|
|
221
|
-
computer=macos_computer,
|
|
222
|
-
loop=AgentLoop.UITARS,
|
|
223
|
-
model=LLM(provider=LLMProvider.MLXVLM, name="mlx-community/UI-TARS-1.5-7B-4bit")
|
|
224
|
-
)
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
2. **OpenAI-compatible UI-TARS**: For using the original ByteDance model
|
|
228
|
-
- If you want to use the original ByteDance UI-TARS model via an OpenAI-compatible API, follow the [deployment guide](https://github.com/bytedance/UI-TARS/blob/main/README_deploy.md)
|
|
229
|
-
- This will give you a provider URL like `https://**************.us-east-1.aws.endpoints.huggingface.cloud/v1` which you can use in the code or Gradio UI:
|
|
230
|
-
|
|
231
|
-
```python
|
|
232
|
-
agent = ComputerAgent(
|
|
233
|
-
computer=macos_computer,
|
|
234
|
-
loop=AgentLoop.UITARS,
|
|
235
|
-
model=LLM(provider=LLMProvider.OAICOMPAT, name="tgi",
|
|
236
|
-
provider_base_url="https://**************.us-east-1.aws.endpoints.huggingface.cloud/v1")
|
|
237
|
-
)
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
## Agent Loops
|
|
241
|
-
|
|
242
|
-
The `cua-agent` package provides three agent loops variations, based on different CUA models providers and techniques:
|
|
243
|
-
|
|
244
|
-
| Agent Loop | Supported Models | Description | Set-Of-Marks |
|
|
245
|
-
|:-----------|:-----------------|:------------|:-------------|
|
|
246
|
-
| `AgentLoop.OPENAI` | • `computer_use_preview` | Use OpenAI Operator CUA model | Not Required |
|
|
247
|
-
| `AgentLoop.ANTHROPIC` | • `claude-3-5-sonnet-20240620`<br>• `claude-3-7-sonnet-20250219` | Use Anthropic Computer-Use | Not Required |
|
|
248
|
-
| `AgentLoop.UITARS` | • `mlx-community/UI-TARS-1.5-7B-4bit` (default)<br>• `mlx-community/UI-TARS-1.5-7B-6bit`<br>• `ByteDance-Seed/UI-TARS-1.5-7B` (via openAI-compatible endpoint) | Uses UI-TARS models with MLXVLM (default) or OAICOMPAT providers | Not Required |
|
|
249
|
-
| `AgentLoop.OMNI` | • `claude-3-5-sonnet-20240620`<br>• `claude-3-7-sonnet-20250219`<br>• `gpt-4.5-preview`<br>• `gpt-4o`<br>• `gpt-4`<br>• `phi4`<br>• `phi4-mini`<br>• `gemma3`<br>• `...`<br>• `Any Ollama or OpenAI-compatible model` | Use OmniParser for element pixel-detection (SoM) and any VLMs for UI Grounding and Reasoning | OmniParser |
|
|
250
|
-
|
|
251
|
-
## AgentResponse
|
|
252
|
-
The `AgentResponse` class represents the structured output returned after each agent turn. It contains the agent's response, reasoning, tool usage, and other metadata. The response format aligns with the new [OpenAI Agent SDK specification](https://platform.openai.com/docs/api-reference/responses) for better consistency across different agent loops.
|
|
253
|
-
|
|
254
|
-
```python
|
|
255
|
-
async for result in agent.run(task):
|
|
256
|
-
print("Response ID: ", result.get("id"))
|
|
257
|
-
|
|
258
|
-
# Print detailed usage information
|
|
259
|
-
usage = result.get("usage")
|
|
260
|
-
if usage:
|
|
261
|
-
print("\nUsage Details:")
|
|
262
|
-
print(f" Input Tokens: {usage.get('input_tokens')}")
|
|
263
|
-
if "input_tokens_details" in usage:
|
|
264
|
-
print(f" Input Tokens Details: {usage.get('input_tokens_details')}")
|
|
265
|
-
print(f" Output Tokens: {usage.get('output_tokens')}")
|
|
266
|
-
if "output_tokens_details" in usage:
|
|
267
|
-
print(f" Output Tokens Details: {usage.get('output_tokens_details')}")
|
|
268
|
-
print(f" Total Tokens: {usage.get('total_tokens')}")
|
|
269
|
-
|
|
270
|
-
print("Response Text: ", result.get("text"))
|
|
271
|
-
|
|
272
|
-
# Print tools information
|
|
273
|
-
tools = result.get("tools")
|
|
274
|
-
if tools:
|
|
275
|
-
print("\nTools:")
|
|
276
|
-
print(tools)
|
|
277
|
-
|
|
278
|
-
# Print reasoning and tool call outputs
|
|
279
|
-
outputs = result.get("output", [])
|
|
280
|
-
for output in outputs:
|
|
281
|
-
output_type = output.get("type")
|
|
282
|
-
if output_type == "reasoning":
|
|
283
|
-
print("\nReasoning Output:")
|
|
284
|
-
print(output)
|
|
285
|
-
elif output_type == "computer_call":
|
|
286
|
-
print("\nTool Call Output:")
|
|
287
|
-
print(output)
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
**Note on Settings Persistence:**
|
|
291
|
-
|
|
292
|
-
* The Gradio UI automatically saves your configuration (Agent Loop, Model Choice, Custom Base URL, Save Trajectory state, Recent Images count) to a file named `.gradio_settings.json` in the project's root directory when you successfully run a task.
|
|
293
|
-
* This allows your preferences to persist between sessions.
|
|
294
|
-
* API keys entered into the custom provider field are **not** saved in this file for security reasons. Manage API keys using environment variables (e.g., `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`) or a `.env` file.
|
|
295
|
-
* It's recommended to add `.gradio_settings.json` to your `.gitignore` file.
|
cua_agent-0.3.1.dist-info/RECORD
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
agent/__init__.py,sha256=PD9Wt2xWtQBH4yPHpVI4pygNiw5f_IXK3DcHVyjOgfI,1480
|
|
2
|
-
agent/core/__init__.py,sha256=3x4XmLSj40-sjUMOtxOuM82RnOQl0I5AwURk5wW_9GE,514
|
|
3
|
-
agent/core/agent.py,sha256=rtzQSPh3a_3z9rQjJ3nvPBjgc8KvyfTEe1Mmr1ZRLCw,8291
|
|
4
|
-
agent/core/base.py,sha256=7hD1rosM-JjyruwSplD4-5YO6BaO1a1bD7bjFYGGUrg,8315
|
|
5
|
-
agent/core/callbacks.py,sha256=uAoJo4rHpVf1d8rzEBFdtSud9jRndPLwDoC4U4uYZlw,6386
|
|
6
|
-
agent/core/experiment.py,sha256=Ywj6q3JZFDKicfPuQsDl0vSN55HS7-Cnk3u3EcUCKe8,8866
|
|
7
|
-
agent/core/factory.py,sha256=zzlCdibctqhf8Uta-SrvE-G7h59wAw-7SGhHiGvS9GY,4608
|
|
8
|
-
agent/core/messages.py,sha256=2bMR_U6A9q1QgzAT5pGaC4FwLs5KNFC6OlW0ZoYSYOY,14335
|
|
9
|
-
agent/core/provider_config.py,sha256=jB3fLsEsf806HQZ8jtzfSq4bCYGYONBeuCOoog_Nv_Y,768
|
|
10
|
-
agent/core/telemetry.py,sha256=87ZTyBaT0wEPQn4v76II3g0V3GERuIVbypoX-Ug6FKQ,4786
|
|
11
|
-
agent/core/tools.py,sha256=53aPme3O8U91n122Smu3TGbyGjQQe2zDimaZgKkFNi0,878
|
|
12
|
-
agent/core/tools/__init__.py,sha256=xZen-PqUp2dUaMEHJowXCQm33_5Sxhsx9PSoD0rq6tI,489
|
|
13
|
-
agent/core/tools/base.py,sha256=CdzRFNuOjNfzgyTUN4ZoCGkUDR5HI0ECQVpvrUdEij8,2295
|
|
14
|
-
agent/core/tools/bash.py,sha256=jnJKVlHn8np8e0gWd8EO0_qqjMkfQzutSugA_Iol4jE,1585
|
|
15
|
-
agent/core/tools/collection.py,sha256=NuwTn6dXSyznxWodfmFDQwUlxxaGb4oBPym4AEJABSQ,1338
|
|
16
|
-
agent/core/tools/computer.py,sha256=lT_aW3huoYpcM8kffuokELupSz_WZG_qkaW1gITRC58,3892
|
|
17
|
-
agent/core/tools/edit.py,sha256=kv4jTKCM0VXrnoNErf7mT-xlr81-7T8v49_VA9y_L4Y,2005
|
|
18
|
-
agent/core/tools/manager.py,sha256=IRsCXjGc076nncQuyIjODoafnHTDhrf9sP5B4q5Pcdo,1742
|
|
19
|
-
agent/core/types.py,sha256=8DBbj2v9EYZ7e4NKbYHnZuWRsGV6tuij7FRSLRrg89I,2444
|
|
20
|
-
agent/core/visualization.py,sha256=1DuFF5sSeSf5BRSevBMDxml9-ajl7BQLFm5KBUwMbI8,6573
|
|
21
|
-
agent/providers/__init__.py,sha256=b4tIBAaIB1V7p8V0BWipHVnMhfHH_OuVgP4OWGSHdD8,194
|
|
22
|
-
agent/providers/anthropic/__init__.py,sha256=Mj11IZnVshZ2iHkvg4Z5-jrQIaD1WvzDz2Zk_pMwqIA,149
|
|
23
|
-
agent/providers/anthropic/api/client.py,sha256=IVCntHAlkHFHPb6h4cEpb4wsBESy0wC6IPG8_Yydtqw,13258
|
|
24
|
-
agent/providers/anthropic/api/logging.py,sha256=vHpwkIyOZdkSTVIH4ycbBPd4a_rzhP7Osu1I-Ayouwc,5154
|
|
25
|
-
agent/providers/anthropic/api_handler.py,sha256=pWXcqDs0ruviDhRNRrz5Ac9ZH4yDv6ZlwpeG3a42cDg,5206
|
|
26
|
-
agent/providers/anthropic/callbacks/__init__.py,sha256=PciBb6Z6MKSwfXqDjU3pV_0FS4MOn_Np_A7_skD-6dA,104
|
|
27
|
-
agent/providers/anthropic/callbacks/manager.py,sha256=euIah5yiM8nhisN-RWXewo6v0WQr0c-FbMBO04r6dJk,1865
|
|
28
|
-
agent/providers/anthropic/loop.py,sha256=T2Ip6Nixsmk67uO-tHIsayrZsMksMp951lnP0QZ6VcM,21847
|
|
29
|
-
agent/providers/anthropic/prompts.py,sha256=EaqyvUb90yybv75VsBYzu4sroga7eMACys0uH9mIVWM,1993
|
|
30
|
-
agent/providers/anthropic/response_handler.py,sha256=ZTprV4NTP9Eb9jQ7QgEKZBX0L6rMj5nqBRiE3Zfws8I,8008
|
|
31
|
-
agent/providers/anthropic/tools/__init__.py,sha256=JyZwuVtPUnZwRSZBSCdQv9yxbLCsygm3l8Ywjjt9qTQ,661
|
|
32
|
-
agent/providers/anthropic/tools/base.py,sha256=WnRDbqO25tQzLpS2RU2ZXTLF5wd5IqU7SiyRAglQat4,2752
|
|
33
|
-
agent/providers/anthropic/tools/bash.py,sha256=bAx5RpXdMCWnEQcp7DaytQ82rqJdgV5QQveWu84oG5I,2224
|
|
34
|
-
agent/providers/anthropic/tools/collection.py,sha256=RBK_6hxfHExR-EOxadiLl0OznmFj07nyIUjFgaYZ6Eo,960
|
|
35
|
-
agent/providers/anthropic/tools/computer.py,sha256=GRmEOyZGQ6Sw7jNx39-WEWdYqQ0X0E5hW2nE2z-52a8,16979
|
|
36
|
-
agent/providers/anthropic/tools/edit.py,sha256=5XzzUhXKzGWxhygIiHw51GC7lfOB97ipwsRlfa_5WVk,13501
|
|
37
|
-
agent/providers/anthropic/tools/manager.py,sha256=yNvgTkfEqnOz5isDF0RxvmBMZB0uh2PipFEH-PUXpoY,2020
|
|
38
|
-
agent/providers/anthropic/tools/run.py,sha256=xhXdnBK1di9muaO44CEirL9hpGy3NmKbjfMpyeVmn8Y,1595
|
|
39
|
-
agent/providers/anthropic/types.py,sha256=SF00kOMC1ui8j9Ah56KaeiR2cL394qCHjFIsBpXxt5w,421
|
|
40
|
-
agent/providers/anthropic/utils.py,sha256=6-lANH2-PjnYcZ_n8uGPbkbk9pqIUad5wh07zzslz3Q,14322
|
|
41
|
-
agent/providers/omni/__init__.py,sha256=5ix67iJdtQNGuGJEjEOF65PwFWO7vdo1QlXD28bRbW4,179
|
|
42
|
-
agent/providers/omni/api_handler.py,sha256=7CpD43lYAqTyNKWfrD8XcM9ekbajqKCTH9p0TWtEQyg,1163
|
|
43
|
-
agent/providers/omni/clients/anthropic.py,sha256=nC_lj3UwrLqx9TIew58yxLqKwrH1_LwJD6EqVSEfp3g,3670
|
|
44
|
-
agent/providers/omni/clients/base.py,sha256=6lN86XKZT3cgBT9EQdz2akKoqbIvc-NXXIOkYKwXObE,946
|
|
45
|
-
agent/providers/omni/clients/oaicompat.py,sha256=ibGX4ezQSqb3-ITaVffADVjMMxWX-Af4gIpgXh-nKvI,7975
|
|
46
|
-
agent/providers/omni/clients/ollama.py,sha256=PmR5EhU9Mi43_o5mZN36XcpiGKp5HbQwlXpiRF9gO3I,4174
|
|
47
|
-
agent/providers/omni/clients/openai.py,sha256=iTSYWEJEM8INFPGJMiUVs8rFn0781XF_ofRkd7NT3gk,5920
|
|
48
|
-
agent/providers/omni/clients/utils.py,sha256=Ani9CVVBm_J2Dl51WG6p1GVuoI6cq8scISrG0pmQ37o,688
|
|
49
|
-
agent/providers/omni/image_utils.py,sha256=wejhWb36yqedsPnLFTFwk2wth8a6txfVWSg4EaNrRdA,908
|
|
50
|
-
agent/providers/omni/loop.py,sha256=hfb2V8WSKjJM50UuoGZ3bnQaj6eeSZWsLt-DIWY1Vr8,43771
|
|
51
|
-
agent/providers/omni/parser.py,sha256=REpQwlwvY1z_N8wbMj6GhOeTiiWVWHhVja_LOxgzbks,11734
|
|
52
|
-
agent/providers/omni/prompts.py,sha256=Mupjy0bUwBjcAeLXpE1r1jisYPSlhwsp-IXJKEKrEtw,3779
|
|
53
|
-
agent/providers/omni/tools/__init__.py,sha256=IC1cMEDoR2ljGcNNthzBRF_VtnDbRL5qvHJWErtNp98,774
|
|
54
|
-
agent/providers/omni/tools/base.py,sha256=HiQ8dp9NbFGlGopbE1wxo0ZbujA7bzCGjCg4tl2lnPE,824
|
|
55
|
-
agent/providers/omni/tools/bash.py,sha256=wocYvWwoaVjHba19CVqc3bvwj8_1qwqYjNaPBbMRlWA,2241
|
|
56
|
-
agent/providers/omni/tools/computer.py,sha256=cB5PrhPmk6acKSENIvzw4rdpjeWx4HQHfSxBLGHzGRE,6964
|
|
57
|
-
agent/providers/omni/tools/manager.py,sha256=UhtasaxGcmkxtz-bP1UJ1a4xdYnD3Cv8PbtB0n2QCDg,2101
|
|
58
|
-
agent/providers/omni/utils.py,sha256=Ikp6ONL1HO637o3KDtv5yv6q-4uIWAzMSQDvGetWXC8,8724
|
|
59
|
-
agent/providers/openai/__init__.py,sha256=8DS6YNZp42NLCacwXsfRaghyczaOCVovX8TgzXUZf_o,165
|
|
60
|
-
agent/providers/openai/api_handler.py,sha256=L1K56dR1j4JsX1sX4OFYeKoCUMM25Fwj2y9nqv8oOhw,17736
|
|
61
|
-
agent/providers/openai/loop.py,sha256=_MyjPu4rpHpTxS2nTSRLHrCbSDkZPK5WEG1APKGP-1U,20717
|
|
62
|
-
agent/providers/openai/response_handler.py,sha256=K8v_92uSr9R74Y5INY4naeEZZZm35CLIl4h74MBZhsw,7953
|
|
63
|
-
agent/providers/openai/tools/__init__.py,sha256=-KbHMWcd2OVTk5RYQ3ACBEMygwbH-VW6n_98p0lwM4A,344
|
|
64
|
-
agent/providers/openai/tools/base.py,sha256=Np_BC9Cm6TslK99etE9hVTtsBlcEaGhoNCK3NXdB_Lw,2474
|
|
65
|
-
agent/providers/openai/tools/computer.py,sha256=g5GzfVC3j0YlyLu1ixaSqHpxLQQ8Zcr_bbyFqm3HyfM,12497
|
|
66
|
-
agent/providers/openai/tools/manager.py,sha256=-wM641dLf8vcv6QF9x_ViGJeDl2YTuUV93j6u7GBI18,3903
|
|
67
|
-
agent/providers/openai/types.py,sha256=0mFUxeFy23fJhMwc6lAFVXKngg2fJIXkPS5oV284V1M,898
|
|
68
|
-
agent/providers/openai/utils.py,sha256=YeCZWIqOFSeugWoqAS0rhxOKAfL-9uN9nrYSBGBgPdc,3175
|
|
69
|
-
agent/providers/uitars/__init__.py,sha256=sq5OMVJP9E_sok9tIiKJreGkjmNWXPMObjPTClYv1es,38
|
|
70
|
-
agent/providers/uitars/clients/base.py,sha256=5w8Ajmq1JiPyUQJUAq1lSkfpA8_Ts80NQiDxPMTtQrI,948
|
|
71
|
-
agent/providers/uitars/clients/mlxvlm.py,sha256=lMnN6ecMmWHf_l7khJ2iJHHvT7PE4XagUjrWhB0zEhc,10893
|
|
72
|
-
agent/providers/uitars/clients/oaicompat.py,sha256=Aw-HMVqRmgNDw-8UxpXU8td4tvTN4ASqGVaNDGPKhSc,8993
|
|
73
|
-
agent/providers/uitars/loop.py,sha256=bVwh5jblogIiiQOAb5NY1hQclOHgB0hDJ5fvnvWef0w,26622
|
|
74
|
-
agent/providers/uitars/prompts.py,sha256=_pQNd438mFpZKZT0aMl6Bd0_GgQxuy9y08kQAMPi9UM,2536
|
|
75
|
-
agent/providers/uitars/tools/__init__.py,sha256=0hc3W6u5TvcXYztYKIyve_C2G3XMfwt_y7grmH0ZHC0,29
|
|
76
|
-
agent/providers/uitars/tools/computer.py,sha256=TeIg_aCtMroxWOBJEiYY_YI4krW_C3pYu51tgGsVUYU,11808
|
|
77
|
-
agent/providers/uitars/tools/manager.py,sha256=2dK9STtz6NuZG3i0nH7ZuHJpb7vKJ2mOVbxGsb0t8lQ,1945
|
|
78
|
-
agent/providers/uitars/utils.py,sha256=493STTEEJcVhVbQgR0e8rNTI1DjkxUx8IgIv3wkJ1SU,8878
|
|
79
|
-
agent/telemetry.py,sha256=pVGxbj0ewnvq4EGj28CydN4a1iOfvZR_XKL3vIOqhOM,390
|
|
80
|
-
agent/ui/__init__.py,sha256=ohhxJLBin6k1hl5sKcmBST8mgh23WXgAXz3pN4f470E,45
|
|
81
|
-
agent/ui/__main__.py,sha256=Ah2575SAf7hI8QCsCKx-W4A6QcFsnFPdqMArmJ4H9ic,299
|
|
82
|
-
agent/ui/gradio/__init__.py,sha256=ANKZhv1HqsLheWbLVBlyRQ7Q5qGeXuPi5jDs8vu-ZMo,579
|
|
83
|
-
agent/ui/gradio/app.py,sha256=7T0IDS9jxMKf9a6KcxdGLmsIEkJ65n0rkCJMILQv_1Q,70605
|
|
84
|
-
cua_agent-0.3.1.dist-info/METADATA,sha256=MXf-cXSEmU4--K0d8gH5RU6RtRTEkfnaaAhMIAtlJ9U,12403
|
|
85
|
-
cua_agent-0.3.1.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
|
86
|
-
cua_agent-0.3.1.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
|
87
|
-
cua_agent-0.3.1.dist-info/RECORD,,
|
|
File without changes
|