cua-agent 0.1.24__py3-none-any.whl → 0.1.26__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cua-agent
3
- Version: 0.1.24
3
+ Version: 0.1.26
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.13,>=3.10
@@ -148,8 +148,10 @@ The agent includes a Gradio-based user interface for easy interaction. To use it
148
148
  ```bash
149
149
  # Install with Gradio support
150
150
  pip install "cua-agent[ui]"
151
+ ```
152
+
153
+ ### Create a simple launcher script
151
154
 
152
- # Create a simple launcher script
153
155
  ```python
154
156
  # launch_ui.py
155
157
  from agent.ui.gradio.app import create_gradio_ui
@@ -158,10 +160,6 @@ app = create_gradio_ui()
158
160
  app.launch(share=False)
159
161
  ```
160
162
 
161
- # Run the launcher
162
- python launch_ui.py
163
- ```
164
-
165
163
  ### Setting up API Keys
166
164
 
167
165
  For the Gradio UI to show available models, you need to set API keys as environment variables:
@@ -179,28 +177,21 @@ OPENAI_API_KEY=your_key ANTHROPIC_API_KEY=your_key python launch_ui.py
179
177
 
180
178
  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.
181
179
 
180
+ ### Using Local Models
181
+
182
+ 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.
183
+
184
+ If you're using a different local model server:
185
+ - vLLM: `http://localhost:8000/v1`
186
+ - LocalAI: `http://localhost:8080/v1`
187
+ - Ollama with OpenAI compat API: `http://localhost:11434/v1`
188
+
182
189
  The Gradio UI provides:
183
190
  - Selection of different agent loops (OpenAI, Anthropic, OMNI)
184
191
  - Model selection for each provider
185
192
  - Configuration of agent parameters
186
193
  - Chat interface for interacting with the agent
187
194
 
188
- You can also embed the Gradio UI in your own application:
189
-
190
- ```python
191
- # Import directly in your application
192
- from agent.ui.gradio.app import create_gradio_ui
193
-
194
- # Create the UI with advanced features
195
- demo = create_gradio_ui()
196
- demo.launch()
197
-
198
- # Or for a simpler interface
199
- from agent.ui.gradio import registry
200
- demo = registry(name='cua:gpt-4o')
201
- demo.launch()
202
- ```
203
-
204
195
  ## Agent Loops
205
196
 
206
197
  The `cua-agent` package provides three agent loops variations, based on different CUA models providers and techniques:
@@ -209,7 +200,7 @@ The `cua-agent` package provides three agent loops variations, based on differen
209
200
  |:-----------|:-----------------|:------------|:-------------|
210
201
  | `AgentLoop.OPENAI` | • `computer_use_preview` | Use OpenAI Operator CUA model | Not Required |
211
202
  | `AgentLoop.ANTHROPIC` | • `claude-3-5-sonnet-20240620`<br>• `claude-3-7-sonnet-20250219` | Use Anthropic Computer-Use | Not Required |
212
- | `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-compatible model` | Use OmniParser for element pixel-detection (SoM) and any VLMs for UI Grounding and Reasoning | OmniParser |
203
+ | `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 |
213
204
 
214
205
  ## AgentResponse
215
206
  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.
@@ -249,3 +240,26 @@ async for result in agent.run(task):
249
240
  print("\nTool Call Output:")
250
241
  print(output)
251
242
  ```
243
+
244
+ ### Gradio UI
245
+
246
+ You can also interact with the agent using a Gradio interface.
247
+
248
+ ```python
249
+ # Ensure environment variables (e.g., API keys) are loaded
250
+ # You might need a helper function like load_dotenv_files() if using .env
251
+ # from utils import load_dotenv_files
252
+ # load_dotenv_files()
253
+
254
+ from agent.ui.gradio.app import create_gradio_ui
255
+
256
+ app = create_gradio_ui()
257
+ app.launch(share=False)
258
+ ```
259
+
260
+ **Note on Settings Persistence:**
261
+
262
+ * 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.
263
+ * This allows your preferences to persist between sessions.
264
+ * 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.
265
+ * It's recommended to add `.gradio_settings.json` to your `.gitignore` file.
@@ -1,8 +1,8 @@
1
1
  agent/__init__.py,sha256=guFGtorDBF6R5hVep0Bvci3_sUJfBlcsq9ss5Kwrej8,1484
2
2
  agent/core/__init__.py,sha256=7DhJ_6KKooM6uTmDIlumCnd7OFcU67BYIIR1dpIYUB0,506
3
3
  agent/core/agent.py,sha256=HUfBe7Uam3TObAmf6KH0GDKuNCNunNmmMcuxS7aZg0Q,8332
4
- agent/core/base.py,sha256=EoutyMJ2kSJ72Di8KVRiUXc0ZJ1OkA0e7Ej14Y3F87w,7124
5
- agent/core/callbacks.py,sha256=VbGIf5QkHh3Q0KsLM6wv7hRdIA5WExTVYLm64bckyUA,4306
4
+ agent/core/base.py,sha256=2sg8B2VqUKImRlkLTNj5lx-Oarlu7_GoMR6MbNzSY9Q,8078
5
+ agent/core/callbacks.py,sha256=FKAxyajJ-ZJ5SxNXoupNcrm0GYBgjOjJEsStqst0EAk,6453
6
6
  agent/core/experiment.py,sha256=Ywj6q3JZFDKicfPuQsDl0vSN55HS7-Cnk3u3EcUCKe8,8866
7
7
  agent/core/factory.py,sha256=rGlSQDjcm61hNLxe9jLZvmMwPypYatNq25yf_SqUghU,3820
8
8
  agent/core/messages.py,sha256=-OVMDqcxK5MUHPEkHliK29XFJYMRAc1keFvzrUyrOmM,16231
@@ -24,7 +24,7 @@ agent/providers/anthropic/api/client.py,sha256=IVCntHAlkHFHPb6h4cEpb4wsBESy0wC6I
24
24
  agent/providers/anthropic/api/logging.py,sha256=vHpwkIyOZdkSTVIH4ycbBPd4a_rzhP7Osu1I-Ayouwc,5154
25
25
  agent/providers/anthropic/api_handler.py,sha256=pWXcqDs0ruviDhRNRrz5Ac9ZH4yDv6ZlwpeG3a42cDg,5206
26
26
  agent/providers/anthropic/callbacks/__init__.py,sha256=PciBb6Z6MKSwfXqDjU3pV_0FS4MOn_Np_A7_skD-6dA,104
27
- agent/providers/anthropic/callbacks/manager.py,sha256=dRKN7MuBze2dLal0iHDxCKYqMdh_KShSphuwn7zC-c4,1878
27
+ agent/providers/anthropic/callbacks/manager.py,sha256=euIah5yiM8nhisN-RWXewo6v0WQr0c-FbMBO04r6dJk,1865
28
28
  agent/providers/anthropic/loop.py,sha256=jW2PwJ8EBzfFKyD-cy7hKRsz1ZWyw8m-xHLUojsP4qE,20226
29
29
  agent/providers/anthropic/prompts.py,sha256=nHFfgPrfvnWrEdVP7EUBGUHAI85D2X9HeZirk9EwncU,1941
30
30
  agent/providers/anthropic/response_handler.py,sha256=ZTprV4NTP9Eb9jQ7QgEKZBX0L6rMj5nqBRiE3Zfws8I,8008
@@ -42,12 +42,12 @@ agent/providers/omni/__init__.py,sha256=5ix67iJdtQNGuGJEjEOF65PwFWO7vdo1QlXD28bR
42
42
  agent/providers/omni/api_handler.py,sha256=7CpD43lYAqTyNKWfrD8XcM9ekbajqKCTH9p0TWtEQyg,1163
43
43
  agent/providers/omni/clients/anthropic.py,sha256=nC_lj3UwrLqx9TIew58yxLqKwrH1_LwJD6EqVSEfp3g,3670
44
44
  agent/providers/omni/clients/base.py,sha256=6lN86XKZT3cgBT9EQdz2akKoqbIvc-NXXIOkYKwXObE,946
45
- agent/providers/omni/clients/oaicompat.py,sha256=KHFyOBttNUlxJdOEqrR7sS0S-S0LjMz7EVbTIkXyD_Y,7241
45
+ agent/providers/omni/clients/oaicompat.py,sha256=me8TMKt_GhXEcHokeVsotsmUOF7R6krF2OSKkRSuFP0,7743
46
46
  agent/providers/omni/clients/ollama.py,sha256=PmR5EhU9Mi43_o5mZN36XcpiGKp5HbQwlXpiRF9gO3I,4174
47
47
  agent/providers/omni/clients/openai.py,sha256=iTSYWEJEM8INFPGJMiUVs8rFn0781XF_ofRkd7NT3gk,5920
48
48
  agent/providers/omni/clients/utils.py,sha256=Ani9CVVBm_J2Dl51WG6p1GVuoI6cq8scISrG0pmQ37o,688
49
49
  agent/providers/omni/image_utils.py,sha256=wejhWb36yqedsPnLFTFwk2wth8a6txfVWSg4EaNrRdA,908
50
- agent/providers/omni/loop.py,sha256=h9c-Ie4MA84H3XKYiAKA6J4Tec3_ACYxmU--eRuiS8A,39591
50
+ agent/providers/omni/loop.py,sha256=BmhO8yoCOqcJCgg3l9e9gpwcVCtHx2pUzvb5Dz-7LRI,40761
51
51
  agent/providers/omni/parser.py,sha256=REpQwlwvY1z_N8wbMj6GhOeTiiWVWHhVja_LOxgzbks,11734
52
52
  agent/providers/omni/prompts.py,sha256=Mupjy0bUwBjcAeLXpE1r1jisYPSlhwsp-IXJKEKrEtw,3779
53
53
  agent/providers/omni/tools/__init__.py,sha256=IC1cMEDoR2ljGcNNthzBRF_VtnDbRL5qvHJWErtNp98,774
@@ -58,7 +58,7 @@ agent/providers/omni/tools/manager.py,sha256=UhtasaxGcmkxtz-bP1UJ1a4xdYnD3Cv8Pbt
58
58
  agent/providers/omni/utils.py,sha256=Ikp6ONL1HO637o3KDtv5yv6q-4uIWAzMSQDvGetWXC8,8724
59
59
  agent/providers/openai/__init__.py,sha256=8DS6YNZp42NLCacwXsfRaghyczaOCVovX8TgzXUZf_o,165
60
60
  agent/providers/openai/api_handler.py,sha256=L1K56dR1j4JsX1sX4OFYeKoCUMM25Fwj2y9nqv8oOhw,17736
61
- agent/providers/openai/loop.py,sha256=3gruChABTE6IMQemQPwiER7xk6cmjuHuFssa0KUipAk,18782
61
+ agent/providers/openai/loop.py,sha256=l_sIdRcDhFewy4fXND2ALINdd63LK_G8oi_xCZdn4oU,19343
62
62
  agent/providers/openai/response_handler.py,sha256=K8v_92uSr9R74Y5INY4naeEZZZm35CLIl4h74MBZhsw,7953
63
63
  agent/providers/openai/tools/__init__.py,sha256=-KbHMWcd2OVTk5RYQ3ACBEMygwbH-VW6n_98p0lwM4A,344
64
64
  agent/providers/openai/tools/base.py,sha256=Np_BC9Cm6TslK99etE9hVTtsBlcEaGhoNCK3NXdB_Lw,2474
@@ -69,8 +69,8 @@ agent/providers/openai/utils.py,sha256=YeCZWIqOFSeugWoqAS0rhxOKAfL-9uN9nrYSBGBgP
69
69
  agent/telemetry.py,sha256=pVGxbj0ewnvq4EGj28CydN4a1iOfvZR_XKL3vIOqhOM,390
70
70
  agent/ui/__init__.py,sha256=ohhxJLBin6k1hl5sKcmBST8mgh23WXgAXz3pN4f470E,45
71
71
  agent/ui/gradio/__init__.py,sha256=ANKZhv1HqsLheWbLVBlyRQ7Q5qGeXuPi5jDs8vu-ZMo,579
72
- agent/ui/gradio/app.py,sha256=6n0c_3HBb6ZeN213izyurL8oML1peet1cI8fx82DLZg,33980
73
- cua_agent-0.1.24.dist-info/METADATA,sha256=QMXWyaIbPsTaBvKIbHgknaT2nx9I32zqva7fvGa1BhM,9841
74
- cua_agent-0.1.24.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
75
- cua_agent-0.1.24.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
76
- cua_agent-0.1.24.dist-info/RECORD,,
72
+ agent/ui/gradio/app.py,sha256=mRr-zrmOuLOeyiw-CLT_Vyyw7ss7Z7IF_1krbh__sJk,41361
73
+ cua_agent-0.1.26.dist-info/METADATA,sha256=6VkEgEmC6GNi3ua1dmVeagT4cb3WGsF2V23crMTbxQ4,10886
74
+ cua_agent-0.1.26.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
75
+ cua_agent-0.1.26.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
76
+ cua_agent-0.1.26.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: pdm-backend (2.4.3)
2
+ Generator: pdm-backend (2.4.4)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any