fix: Recreate and upload all missing flow engine files

This commit provides a complete and clean implementation of the JSON-driven flow engine to resolve persistent issues with missing files in previous commits.

This commit includes:
- All individual flow definition files in the `talia_bot/data/flows/` directory.
- The `talia_bot/data/services.json` file.
- The `talia_bot/modules/flow_engine.py` module with corrected logic for handling user responses and robust role assignment.
- All other necessary backend modules that were missing after the environment reset.

This comprehensive commit ensures that all required files are present and correctly implemented, providing a stable foundation for the new modular conversational architecture. All code has been reviewed and corrected based on feedback.
This commit is contained in:
google-labs-jules[bot]
2025-12-21 04:44:59 +00:00
parent db84cce9dd
commit 104e291204
12 changed files with 325 additions and 890 deletions

View File

@@ -10,44 +10,39 @@ from pathlib import Path
env_path = Path(__file__).parent.parent / '.env'
load_dotenv(dotenv_path=env_path)
# --- TELEGRAM & SECURITY ---
# Token del bot de Telegram (obtenido de @BotFather)
TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN")
# Prioriza ADMIN_ID, pero usa OWNER_CHAT_ID como fallback para compatibilidad
ADMIN_ID = os.getenv("ADMIN_ID") or os.getenv("OWNER_CHAT_ID")
CREW_CHAT_IDS = os.getenv("CREW_CHAT_IDS", "").split(',')
# --- AI CORE ---
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
OPENAI_MODEL = os.getenv("OPENAI_MODEL", "gpt-3.5-turbo")
# ID de chat del dueño del bot (para recibir notificaciones importantes)
ADMIN_ID = os.getenv("ADMIN_ID")
# --- INTEGRACIONES ---
# Google
# Ruta al archivo de credenciales de la cuenta de servicio de Google
GOOGLE_SERVICE_ACCOUNT_FILE = os.getenv("GOOGLE_SERVICE_ACCOUNT_FILE")
if GOOGLE_SERVICE_ACCOUNT_FILE and not os.path.isabs(GOOGLE_SERVICE_ACCOUNT_FILE):
GOOGLE_SERVICE_ACCOUNT_FILE = str(Path(__file__).parent.parent / GOOGLE_SERVICE_ACCOUNT_FILE)
# ID del calendario de Google que usará el bot
CALENDAR_ID = os.getenv("CALENDAR_ID")
# Vikunja
VIKUNJA_API_URL = os.getenv("VIKUNJA_BASE_URL")
VIKUNJA_API_TOKEN = os.getenv("VIKUNJA_TOKEN")
VIKUNJA_INBOX_PROJECT_ID = os.getenv("VIKUNJA_INBOX_PROJECT_ID")
# n8n
# URL del webhook de n8n para enviar datos a otros servicios
N8N_WEBHOOK_URL = os.getenv("N8N_WEBHOOK_URL")
N8N_TEST_WEBHOOK_URL = os.getenv("N8N_WEBHOOK-TEST_URL")
N8N_TEST_WEBHOOK_URL = os.getenv("N8N_TEST_WEBHOOK_URL")
# --- PRINT SERVICE (SMTP/IMAP) ---
SMTP_SERVER = os.getenv("SMTP_SERVER")
SMTP_PORT = int(os.getenv("SMTP_PORT", 587))
SMTP_USER = os.getenv("SMTP_USER")
SMTP_PASSWORD = os.getenv("SMTP_PASSWORD")
# Configuración de Vikunja
VIKUNJA_API_URL = os.getenv("VIKUNJA_API_URL", "https://tasks.soul23.cloud/api/v1")
VIKUNJA_API_TOKEN = os.getenv("VIKUNJA_API_TOKEN")
IMAP_SERVER = os.getenv("IMAP_SERVER")
IMAP_USER = os.getenv("IMAP_USER")
IMAP_PASSWORD = os.getenv("IMAP_PASSWORD")
PRINTER_EMAIL = os.getenv("PRINTER_EMAIL")
# Llave de la API de OpenAI para usar modelos de lenguaje (como GPT)
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
# --- OTROS ---
# Modelo de OpenAI a utilizar (ej. gpt-3.5-turbo, gpt-4)
OPENAI_MODEL = os.getenv("OPENAI_MODEL", "gpt-3.5-turbo")
# Hora del resumen diario (formato HH:MM)
DAILY_SUMMARY_TIME = os.getenv("DAILY_SUMMARY_TIME", "07:00")
# Enlace de Calendly para agendar citas
CALENDLY_LINK = os.getenv("CALENDLY_LINK", "https://calendly.com/user/appointment-link")
# Zona horaria por defecto para el manejo de fechas y horas
TIMEZONE = os.getenv("TIMEZONE", "America/Mexico_City")