File size: 954 Bytes
6fdf170
 
 
 
 
 
12832d8
 
e627b57
6fdf170
 
12832d8
6fdf170
 
 
 
 
29f5dfb
fb62834
 
 
6fdf170
12832d8
 
 
 
6fdf170
 
12832d8
 
6fdf170
12832d8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""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) -----------------
@app.get("/")
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)