Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

.env fixes, use CUA_API_KEY in app.py

Dillon DuPont0d3bebf32d55
diff --git a/libs/agent/agent/ui/gradio/app.py b/libs/agent/agent/ui/gradio/app.py
index b4f8bddd71..a6dfa33cc5 100644
--- a/libs/agent/agent/ui/gradio/app.py
+++ b/libs/agent/agent/ui/gradio/app.py
@@ -445,7 +445,8 @@ def create_gradio_ui(
# Check for API keys
openai_api_key = os.environ.get("OPENAI_API_KEY", "")
anthropic_api_key = os.environ.get("ANTHROPIC_API_KEY", "")
-
+ cua_api_key = os.environ.get("CUA_API_KEY", "")
+
# Always show models regardless of API key availability
openai_models = ["OpenAI: Computer-Use Preview"]
anthropic_models = [
@@ -463,9 +464,11 @@ def create_gradio_ui(
# Check if API keys are available
has_openai_key = bool(openai_api_key)
has_anthropic_key = bool(anthropic_api_key)
+ has_cua_key = bool(cua_api_key)
print("has_openai_key", has_openai_key)
print("has_anthropic_key", has_anthropic_key)
+ print("has_cua_key", has_cua_key)
# Get Ollama models for OMNI
ollama_models = get_ollama_models()
@@ -747,6 +750,7 @@ if __name__ == "__main__":
value="",
type="password",
info="Required for cloud provider",
+ visible=(not has_cua_key)
)
with gr.Accordion("Agent Configuration", open=True):
@@ -1171,6 +1175,8 @@ if __name__ == "__main__":
else:
# For Ollama or default OAICOMPAT (without custom key), no key needed/expected
api_key = ""
+
+ cua_cloud_api_key = cua_cloud_api_key or os.environ.get("CUA_API_KEY", "")
# --- Save Settings Before Running Agent ---
current_settings = {
diff --git a/scripts/playground.sh b/scripts/playground.sh
index 8193f022d2..7e7f038aa1 100755
--- a/scripts/playground.sh
+++ b/scripts/playground.sh
@@ -175,9 +175,9 @@ mkdir -p "$DEMO_DIR"
# Create .env.local file with API keys (only if it doesn't exist)
if [[ ! -f "$DEMO_DIR/.env.local" ]]; then
cat > "$DEMO_DIR/.env.local" << EOF
-# Add your API keys here
-OPENAI_API_KEY=your_openai_api_key_here
-ANTHROPIC_API_KEY=your_anthropic_api_key_here
+# Uncomment and add your API keys here
+# OPENAI_API_KEY=your_openai_api_key_here
+# ANTHROPIC_API_KEY=your_anthropic_api_key_here
CUA_API_KEY=your_cua_api_key_here
EOF
echo "📝 Created .env.local file with API key placeholders"