mirror of
https://github.com/hanzoai/agents.git
synced 2026-10-30 18:48:36 +00:00
The server mounts /v1, /v1/ui and /v2/ui. The UI and its dev proxy, the helm and kubernetes health probes, functional tests, project templates, examples and scripts still called /api/v1, so the probes failed and the UI's requests missed. Co-authored-by: Hanzo Dev <[email protected]>
# {{.ProjectName}}
A Hanzo Agents agent created with `af init`.
## Quick Start
1. **Install dependencies:**
```bash
pip install -r requirements.txt
```
2. **Start the Hanzo Agents server** (in another terminal):
```bash
af server
```
3. **Run the agent:**
```bash
python main.py
```
The agent will auto-discover an available port and register with Hanzo Agents.
## Test the Agent
### Echo Reasoner (No AI Required)
```bash
curl -X POST http://localhost:8080/v1/execute/{{.NodeID}}.demo_echo \
-H "Content-Type: application/json" \
-d '{"input": {"message": "Hello World"}}'
```
### Enable AI Features
1. Uncomment the `ai_config` in `main.py`
2. Set your API key: `export OPENAI_API_KEY=sk-...`
- Or use `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`, etc. for other providers
- LiteLLM auto-detects the provider from the model name
3. Uncomment the `analyze_sentiment` reasoner in `reasoners.py`
4. Restart the agent
```bash
curl -X POST http://localhost:8080/v1/execute/{{.NodeID}}.demo_analyze_sentiment \
-H "Content-Type: application/json" \
-d '{"input": {"text": "I love this product!"}}'
```
## Project Structure
- `main.py` - Agent configuration and startup
- `reasoners.py` - Reasoner definitions (AI-powered functions)
- `requirements.txt` - Python dependencies
- `.env.example` - Environment variable examples
## Learn More
- [Hanzo Agents Documentation](https://hanzo_agents.ai/docs)
- [SDK Reference](https://hanzo_agents.ai/docs/sdk)
---
Created by {{.AuthorName}} ({{.AuthorEmail}}) on {{.CreatedAt}}