feat: Add docs

This commit is contained in:
2026-02-15 16:03:09 -05:00
parent e28c42ddd8
commit 9823bc19d2
14 changed files with 3208 additions and 0 deletions

160
README.md
View File

@@ -0,0 +1,160 @@
# NaliiaBot
Agente conversacional basado en LangGraph para gestión de agenda.
## 🚀 Características
- Agente conversacional inteligente
- Sistema de tools (herramientas) con patrón Registry
- Integración con modelos LLM (Anthropic)
- API FastAPI para interacción
- Tests completos
- Documentación exhaustiva
## 📚 Documentación
### Sistema de Herramientas (Tools)
Toda la documentación sobre cómo crear y usar herramientas está en **[`docs/`](docs/)**
**Comienza aquí:**
1. [docs/INICIO.txt](docs/INICIO.txt) - Bienvenida (2 min)
2. [docs/TOOLS_DOCUMENTATION_INDEX.md](docs/TOOLS_DOCUMENTATION_INDEX.md) - Índice (10 min)
3. [docs/QUICK_START.py](docs/QUICK_START.py) - Tutorial (5 min)
Ver [README_TOOLS.md](README_TOOLS.md) para más detalles.
## 🏗️ Estructura del proyecto
```
NaliiaBot/
├── docs/ # Documentación completa
│ ├── INICIO.txt
│ ├── TOOLS_DOCUMENTATION_INDEX.md
│ ├── QUICK_START.py
│ ├── TOOLS_GUIDE.md
│ ├── AGENDA_TOOLS_EXAMPLE.py
│ └── ...
├── src/
│ ├── naliiabot/
│ │ ├── bot/
│ │ │ ├── agent/ # Agente principal
│ │ │ │ ├── agent.py
│ │ │ │ └── schemas.py
│ │ │ └── tools/ # Sistema de tools
│ │ │ ├── __init__.py
│ │ │ ├── tool_registry.py
│ │ │ └── tools.py # ← Define aquí tus tools
│ │ └── naliiabotapi/
│ │ └── main.py # API FastAPI
│ └── ui/
│ └── ... # Frontend
├── tests/
│ ├── test_agent.py
│ ├── test_naliia_agent_tools.py
│ └── ...
└── README.md (este archivo)
```
## 🔧 Instalación
```bash
# Clonar proyecto
git clone <repo>
cd NaliiaBot
# Instalar dependencias
pip install -r requirements.txt
# Configurar variables de entorno
cp .env.example .env
# Editar .env con tus configuraciones
```
## 🚀 Uso
### Crear herramientas
En `src/naliiabot/bot/tools/tools.py`:
```python
from .tool_registry import BaseTool
class MiHerramienta(BaseTool):
@property
def name(self) -> str:
return "mi_herramienta"
@property
def description(self) -> str:
return "Descripción"
@property
def args_schema(self):
return {...}
def invoke(self, **kwargs) -> str:
return "resultado"
```
### Usar el agente
```python
from src.naliiabot.bot.tools import ToolRegistry
from src.naliiabot.bot.tools.tools import MiHerramienta
from src.naliiabot.bot.agent.agent import Agent
from langchain_anthropic import ChatAnthropic
# Crear registry
registry = ToolRegistry()
registry.register(MiHerramienta())
# Crear agente
modelo = ChatAnthropic(model="claude-3-5-sonnet-20241022")
agent = Agent(model=modelo, tools=registry.get_all_tools_as_langchain())
# Usar agente
resultado = agent.invoke({"messages": [...]})
```
## 📖 Documentación detallada
| Tema | Ubicación |
|------|-----------|
| Sistema de tools | [docs/TOOLS_DOCUMENTATION_INDEX.md](docs/TOOLS_DOCUMENTATION_INDEX.md) |
| Quick start | [docs/QUICK_START.py](docs/QUICK_START.py) |
| Guía completa | [docs/TOOLS_GUIDE.md](docs/TOOLS_GUIDE.md) |
| Ejemplos | [docs/AGENDA_TOOLS_EXAMPLE.py](docs/AGENDA_TOOLS_EXAMPLE.py) |
## ✅ Tests
```bash
# Ejecutar todos los tests
pytest
# Tests específicos
pytest tests/test_naliia_agent_tools.py -v
```
## 🔗 Enlaces útiles
- [Documentación de tools](README_TOOLS.md)
- [Sistema Registry](docs/TOOLS_DOCUMENTATION_INDEX.md)
- [Ejemplos de herramientas](docs/AGENDA_TOOLS_EXAMPLE.py)
## 📝 Licencia
Especificar la licencia del proyecto
## 👥 Contribuciones
Para contribuir al proyecto, por favor:
1. Fork el repositorio
2. Crea una rama para tu feature
3. Commit tus cambios
4. Push a la rama
5. Abre un Pull Request