Spaces:
Paused
Paused
| """Flare – Minimal backend bootstrap (no UI controllers) | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| Yalnızca sağlık kontrolü, session ve chat endpoint’leri içerir. | |
| UI controller’ları tamamlandığında yeniden eklenecek. | |
| """ | |
| from fastapi import FastAPI | |
| import uvicorn | |
| from utils import log | |
| from chat_handler import router as chat_router # ← start_session & chat | |
| app = FastAPI( | |
| title="Flare Orchestration Service", | |
| version="0.1.0", | |
| description="LLM-driven intent & API flow engine (bootstrap)", | |
| ) | |
| from spark_startup import run_in_thread | |
| run_in_thread() | |
| # ---------------- Health probe (HF Spaces watchdog) ----------------- | |
| def health_check(): | |
| return {"status": "ok"} | |
| # ---------------- Core chat/session routes -------------------------- | |
| app.include_router(chat_router) | |
| if __name__ == "__main__": | |
| log("🌐 Starting Flare backend …") | |
| uvicorn.run(app, host="0.0.0.0", port=7860) | |