Fix ui instructions

This commit is contained in:
f-trycua
2025-04-06 12:00:23 -07:00
parent 3f1ebf8705
commit 5e3ffcccf1
3 changed files with 49 additions and 26 deletions
+22
View File
@@ -83,12 +83,34 @@ pip install "cua-agent[ui]"
# Create a simple launcher script
```python
# launch_ui.py
from agent.ui.gradio.app import create_gradio_ui
app = create_gradio_ui()
app.launch(share=False)
```
# Run the launcher
python launch_ui.py
```
### Setting up API Keys
For the Gradio UI to show available models, you need to set API keys as environment variables:
```bash
# For OpenAI models
export OPENAI_API_KEY=your_openai_key_here
# For Anthropic models
export ANTHROPIC_API_KEY=your_anthropic_key_here
# Launch with both keys set
OPENAI_API_KEY=your_key ANTHROPIC_API_KEY=your_key python launch_ui.py
```
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.
The Gradio UI provides:
- Selection of different agent loops (OpenAI, Anthropic, OMNI)
- Model selection for each provider
-17
View File
@@ -54,23 +54,6 @@ LLMModel = LLM
Model = LLM
# Default models for each provider
PROVIDER_TO_DEFAULT_MODEL: Dict[LLMProvider, str] = {
LLMProvider.ANTHROPIC: "claude-3-7-sonnet-20250219",
LLMProvider.OPENAI: "gpt-4o",
LLMProvider.OLLAMA: "gemma3:4b-it-q4_K_M",
LLMProvider.OAICOMPAT: "Qwen2.5-VL-7B-Instruct",
}
# Environment variable names for each provider
PROVIDER_TO_ENV_VAR: Dict[LLMProvider, str] = {
LLMProvider.ANTHROPIC: "ANTHROPIC_API_KEY",
LLMProvider.OPENAI: "OPENAI_API_KEY",
LLMProvider.OLLAMA: "none",
LLMProvider.OAICOMPAT: "none",
}
class AgentResponse(TypedDict, total=False):
"""Agent response format."""