Update api.py
Browse files
api.py
CHANGED
|
@@ -4,6 +4,22 @@ from vectorstore import create_vectorstore
|
|
| 4 |
from rag_chain import build_rag_chain
|
| 5 |
import os
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
app = FastAPI()
|
| 8 |
qa_chain = None
|
| 9 |
|
|
|
|
| 4 |
from rag_chain import build_rag_chain
|
| 5 |
import os
|
| 6 |
|
| 7 |
+
import traceback
|
| 8 |
+
|
| 9 |
+
app = FastAPI()
|
| 10 |
+
|
| 11 |
+
@app.on_event("startup")
|
| 12 |
+
def on_startup():
|
| 13 |
+
# Helpful startup log to confirm FastAPI loaded successfully
|
| 14 |
+
print("===== FASTAPI startup event fired =====")
|
| 15 |
+
|
| 16 |
+
@app.get("/health")
|
| 17 |
+
def health():
|
| 18 |
+
return {"status": "ok"}
|
| 19 |
+
|
| 20 |
+
# existing endpoints below ...
|
| 21 |
+
# keep your /load and /ask endpoints as before
|
| 22 |
+
|
| 23 |
app = FastAPI()
|
| 24 |
qa_chain = None
|
| 25 |
|