paczade commited on
Commit
0f5c847
·
verified ·
1 Parent(s): 593cb8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI
2
+ from rag import RAG
3
+
4
+ app = FastAPI()
5
+ rag = RAG()
6
+
7
+ @app.post("/ask")
8
+ async def ask_question(payload: dict):
9
+ question = payload.get("question", "")
10
+ answer = rag.generate_answer(question)
11
+ return {"answer": answer}