aman1762 commited on
Commit
e038f35
·
verified ·
1 Parent(s): f7e7154

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +16 -0
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