cua-agent 0.1.34__tar.gz → 0.1.35__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.

Files changed (84) hide show
  1. {cua_agent-0.1.34 → cua_agent-0.1.35}/PKG-INFO +1 -1
  2. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/ui/gradio/app.py +101 -29
  3. {cua_agent-0.1.34 → cua_agent-0.1.35}/pyproject.toml +3 -3
  4. {cua_agent-0.1.34 → cua_agent-0.1.35}/README.md +0 -0
  5. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/__init__.py +0 -0
  6. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/__init__.py +0 -0
  7. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/agent.py +0 -0
  8. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/base.py +0 -0
  9. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/callbacks.py +0 -0
  10. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/experiment.py +0 -0
  11. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/factory.py +0 -0
  12. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/messages.py +0 -0
  13. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/provider_config.py +0 -0
  14. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/telemetry.py +0 -0
  15. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/tools/__init__.py +0 -0
  16. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/tools/base.py +0 -0
  17. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/tools/bash.py +0 -0
  18. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/tools/collection.py +0 -0
  19. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/tools/computer.py +0 -0
  20. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/tools/edit.py +0 -0
  21. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/tools/manager.py +0 -0
  22. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/tools.py +0 -0
  23. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/types.py +0 -0
  24. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/core/visualization.py +0 -0
  25. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/__init__.py +0 -0
  26. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/__init__.py +0 -0
  27. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/api/client.py +0 -0
  28. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/api/logging.py +0 -0
  29. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/api_handler.py +0 -0
  30. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/callbacks/__init__.py +0 -0
  31. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/callbacks/manager.py +0 -0
  32. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/loop.py +0 -0
  33. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/prompts.py +0 -0
  34. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/response_handler.py +0 -0
  35. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/tools/__init__.py +0 -0
  36. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/tools/base.py +0 -0
  37. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/tools/bash.py +0 -0
  38. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/tools/collection.py +0 -0
  39. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/tools/computer.py +0 -0
  40. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/tools/edit.py +0 -0
  41. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/tools/manager.py +0 -0
  42. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/tools/run.py +0 -0
  43. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/types.py +0 -0
  44. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/anthropic/utils.py +0 -0
  45. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/__init__.py +0 -0
  46. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/api_handler.py +0 -0
  47. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/clients/anthropic.py +0 -0
  48. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/clients/base.py +0 -0
  49. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/clients/oaicompat.py +0 -0
  50. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/clients/ollama.py +0 -0
  51. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/clients/openai.py +0 -0
  52. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/clients/utils.py +0 -0
  53. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/image_utils.py +0 -0
  54. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/loop.py +0 -0
  55. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/parser.py +0 -0
  56. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/prompts.py +0 -0
  57. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/tools/__init__.py +0 -0
  58. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/tools/base.py +0 -0
  59. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/tools/bash.py +0 -0
  60. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/tools/computer.py +0 -0
  61. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/tools/manager.py +0 -0
  62. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/omni/utils.py +0 -0
  63. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/__init__.py +0 -0
  64. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/api_handler.py +0 -0
  65. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/loop.py +0 -0
  66. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/response_handler.py +0 -0
  67. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/tools/__init__.py +0 -0
  68. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/tools/base.py +0 -0
  69. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/tools/computer.py +0 -0
  70. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/tools/manager.py +0 -0
  71. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/types.py +0 -0
  72. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/openai/utils.py +0 -0
  73. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/uitars/__init__.py +0 -0
  74. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/uitars/clients/base.py +0 -0
  75. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/uitars/clients/oaicompat.py +0 -0
  76. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/uitars/loop.py +0 -0
  77. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/uitars/prompts.py +0 -0
  78. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/uitars/tools/__init__.py +0 -0
  79. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/uitars/tools/computer.py +0 -0
  80. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/uitars/tools/manager.py +0 -0
  81. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/providers/uitars/utils.py +0 -0
  82. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/telemetry.py +0 -0
  83. {cua_agent-0.1.34 → cua_agent-0.1.35}/agent/ui/__init__.py +0 -0
  84. {cua_agent-0.1.34 → cua_agent-0.1.35}/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.1.34
3
+ Version: 0.1.35
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.10
@@ -412,25 +412,23 @@ def create_gradio_ui(
412
412
  openai_api_key = os.environ.get("OPENAI_API_KEY", "")
413
413
  anthropic_api_key = os.environ.get("ANTHROPIC_API_KEY", "")
414
414
 
415
- # Prepare model choices based on available API keys
416
- openai_models = []
417
- anthropic_models = []
418
- omni_models = []
419
-
420
- if openai_api_key:
421
- openai_models = ["OpenAI: Computer-Use Preview"]
422
- omni_models += [
423
- "OMNI: OpenAI GPT-4o",
424
- "OMNI: OpenAI GPT-4o mini",
425
- "OMNI: OpenAI GPT-4.5-preview",
426
- ]
427
-
428
- if anthropic_api_key:
429
- anthropic_models = [
430
- "Anthropic: Claude 3.7 Sonnet (20250219)",
431
- "Anthropic: Claude 3.5 Sonnet (20240620)",
432
- ]
433
- omni_models += ["OMNI: Claude 3.7 Sonnet (20250219)", "OMNI: Claude 3.5 Sonnet (20240620)"]
415
+ # Always show models regardless of API key availability
416
+ openai_models = ["OpenAI: Computer-Use Preview"]
417
+ anthropic_models = [
418
+ "Anthropic: Claude 3.7 Sonnet (20250219)",
419
+ "Anthropic: Claude 3.5 Sonnet (20240620)",
420
+ ]
421
+ omni_models = [
422
+ "OMNI: OpenAI GPT-4o",
423
+ "OMNI: OpenAI GPT-4o mini",
424
+ "OMNI: OpenAI GPT-4.5-preview",
425
+ "OMNI: Claude 3.7 Sonnet (20250219)",
426
+ "OMNI: Claude 3.5 Sonnet (20240620)"
427
+ ]
428
+
429
+ # Check if API keys are available
430
+ has_openai_key = bool(openai_api_key)
431
+ has_anthropic_key = bool(anthropic_api_key)
434
432
 
435
433
  # Get Ollama models for OMNI
436
434
  ollama_models = get_ollama_models()
@@ -568,16 +566,51 @@ if __name__ == "__main__":
568
566
  elif "Custom model..." not in models:
569
567
  models.append("Custom model...")
570
568
 
571
- return gr.update(
572
- choices=models, value=models[0] if models else "Custom model...", interactive=True
573
- )
569
+ # Show both OpenAI and Anthropic key inputs for OMNI if keys aren't set
570
+ return [
571
+ gr.update(choices=models, value=models[0] if models else "Custom model...", interactive=True),
572
+ gr.update(visible=not has_openai_key),
573
+ gr.update(visible=not has_anthropic_key)
574
+ ]
575
+ elif loop == "OPENAI":
576
+ # Show only OpenAI key input for OPENAI loop if key isn't set
577
+ if not models:
578
+ return [
579
+ gr.update(choices=["No models available"], value="No models available", interactive=True),
580
+ gr.update(visible=not has_openai_key),
581
+ gr.update(visible=False)
582
+ ]
583
+ return [
584
+ gr.update(choices=models, value=models[0] if models else None, interactive=True),
585
+ gr.update(visible=not has_openai_key),
586
+ gr.update(visible=False)
587
+ ]
588
+ elif loop == "ANTHROPIC":
589
+ # Show only Anthropic key input for ANTHROPIC loop if key isn't set
590
+ if not models:
591
+ return [
592
+ gr.update(choices=["No models available"], value="No models available", interactive=True),
593
+ gr.update(visible=False),
594
+ gr.update(visible=not has_anthropic_key)
595
+ ]
596
+ return [
597
+ gr.update(choices=models, value=models[0] if models else None, interactive=True),
598
+ gr.update(visible=False),
599
+ gr.update(visible=not has_anthropic_key)
600
+ ]
574
601
  else:
575
- # For other providers, use standard dropdown without custom option
602
+ # For other providers (like UITARS), don't show API key inputs
576
603
  if not models:
577
- return gr.update(
578
- choices=["No models available"], value="No models available", interactive=True
579
- )
580
- return gr.update(choices=models, value=models[0] if models else None, interactive=True)
604
+ return [
605
+ gr.update(choices=["No models available"], value="No models available", interactive=True),
606
+ gr.update(visible=False),
607
+ gr.update(visible=False)
608
+ ]
609
+ return [
610
+ gr.update(choices=models, value=models[0] if models else None, interactive=True),
611
+ gr.update(visible=False),
612
+ gr.update(visible=False)
613
+ ]
581
614
 
582
615
  # Create the Gradio interface with advanced UI
583
616
  with gr.Blocks(title="Computer-Use Agent") as demo:
@@ -646,6 +679,27 @@ if __name__ == "__main__":
646
679
  interactive=True,
647
680
  )
648
681
 
682
+ # Add API key inputs for OpenAI and Anthropic
683
+ with gr.Group(visible=not has_openai_key and (initial_loop == "OPENAI" or initial_loop == "OMNI")) as openai_key_group:
684
+ openai_api_key_input = gr.Textbox(
685
+ label="OpenAI API Key",
686
+ placeholder="Enter your OpenAI API key",
687
+ value="",
688
+ interactive=True,
689
+ type="password",
690
+ info="Required for OpenAI models"
691
+ )
692
+
693
+ with gr.Group(visible=not has_anthropic_key and (initial_loop == "ANTHROPIC" or initial_loop == "OMNI")) as anthropic_key_group:
694
+ anthropic_api_key_input = gr.Textbox(
695
+ label="Anthropic API Key",
696
+ placeholder="Enter your Anthropic API key",
697
+ value="",
698
+ interactive=True,
699
+ type="password",
700
+ info="Required for Anthropic models"
701
+ )
702
+
649
703
  # Add custom model textbox (only visible when "Custom model..." is selected)
650
704
  custom_model = gr.Textbox(
651
705
  label="Custom Model Name",
@@ -724,6 +778,8 @@ if __name__ == "__main__":
724
778
  recent_imgs,
725
779
  custom_url_value=None,
726
780
  custom_api_key=None,
781
+ openai_key_input=None,
782
+ anthropic_key_input=None,
727
783
  ):
728
784
  if not history:
729
785
  yield history
@@ -769,9 +825,15 @@ if __name__ == "__main__":
769
825
  f"DEBUG - Using custom API key for model: {final_model_name_to_send}"
770
826
  )
771
827
  elif provider == LLMProvider.OPENAI:
772
- api_key = openai_api_key or os.environ.get("OPENAI_API_KEY", "")
828
+ # Use OpenAI key from input if provided, otherwise use environment variable
829
+ api_key = openai_key_input if openai_key_input else (openai_api_key or os.environ.get("OPENAI_API_KEY", ""))
830
+ if openai_key_input:
831
+ print(f"DEBUG - Using provided OpenAI API key from UI")
773
832
  elif provider == LLMProvider.ANTHROPIC:
774
- api_key = anthropic_api_key or os.environ.get("ANTHROPIC_API_KEY", "")
833
+ # Use Anthropic key from input if provided, otherwise use environment variable
834
+ api_key = anthropic_key_input if anthropic_key_input else (anthropic_api_key or os.environ.get("ANTHROPIC_API_KEY", ""))
835
+ if anthropic_key_input:
836
+ print(f"DEBUG - Using provided Anthropic API key from UI")
775
837
  else:
776
838
  # For Ollama or default OAICOMPAT (without custom key), no key needed/expected
777
839
  api_key = ""
@@ -917,6 +979,8 @@ if __name__ == "__main__":
917
979
  recent_images,
918
980
  provider_base_url,
919
981
  provider_api_key,
982
+ openai_api_key_input,
983
+ anthropic_api_key_input,
920
984
  ],
921
985
  [chatbot_history],
922
986
  )
@@ -947,6 +1011,14 @@ if __name__ == "__main__":
947
1011
  outputs=[custom_model, provider_base_url, provider_api_key],
948
1012
  queue=False, # Process immediately without queueing
949
1013
  )
1014
+
1015
+ # Connect agent_loop changes to model selection and API key visibility
1016
+ agent_loop.change(
1017
+ fn=update_model_choices,
1018
+ inputs=[agent_loop],
1019
+ outputs=[model_choice, openai_key_group, anthropic_key_group],
1020
+ queue=False, # Process immediately without queueing
1021
+ )
950
1022
 
951
1023
  # Function to update the code display based on configuration and chat history
952
1024
  def update_code_display(agent_loop, model_choice_val, custom_model_val, chat_history, provider_base_url, recent_images_val, save_trajectory_val):
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "cua-agent"
9
- version = "0.1.34"
9
+ version = "0.1.35"
10
10
  description = "CUA (Computer Use) Agent for AI-driven computer interaction"
11
11
  readme = "README.md"
12
12
  authors = [
@@ -108,7 +108,7 @@ target-version = [
108
108
 
109
109
  [tool.ruff]
110
110
  line-length = 100
111
- target-version = "0.1.34"
111
+ target-version = "0.1.35"
112
112
  select = [
113
113
  "E",
114
114
  "F",
@@ -122,7 +122,7 @@ docstring-code-format = true
122
122
 
123
123
  [tool.mypy]
124
124
  strict = true
125
- python_version = "0.1.34"
125
+ python_version = "0.1.35"
126
126
  ignore_missing_imports = true
127
127
  disallow_untyped_defs = true
128
128
  check_untyped_defs = true
File without changes
File without changes