You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
orquestrador/app/main.py

24 lines
608 B
Python

from fastapi import FastAPI
from app.db.init_db import init_db
from app.services.ai.llm_service import LLMService
app = FastAPI(title="AI Orquestrador")
@app.on_event("startup")
async def startup_event():
"""
Inicializa o banco de dados e executa seeds automaticamente.
"""
print("[Startup] Iniciando bootstrap legado do app HTTP...")
init_db()
try:
await LLMService().warmup()
print("[Startup] LLM warmup concluido.")
except Exception as e:
print(f"[Startup] Aviso: falha no warmup do LLM: {e}")
print("[Startup] App HTTP legado inicializado.")