mirror of
https://github.com/trycua/computer.git
synced 2026-04-24 23:50:15 -05:00
Fix ui instructions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user