File size: 617 Bytes
570f7bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from dotenv import load_dotenv
load_dotenv()

from fastapi import FastAPI
from app.routers import nl2sql
app = FastAPI(
    title="NL2SQL Copilot Prototype",
    version="0.1.0",
    description="Natural Language -> SQL Copilot API"
)

app.include_router(nl2sql.router, prefix="/api/v1")

@app.get("/healthz")
def health_check():
    return {"status": "ok"}

@app.get("/")
def root():
    return {"status": "ok", "message": "NL2SQL Copilot API is running"}

@app.get("/health")
def health():
    return {
        "status": "ok",
        "db": "connected",
        "llm": "reachable",
        "uptime_sec": 123.4
    }