Sacrifice / app.py
paczade's picture
Update app.py
a552062 verified
Raw
History Blame Contribute Delete
346 Bytes
from fastapi import FastAPI
from rag import RAG
app = FastAPI()
rag = RAG()
@app.post("/ask")
async def ask_question(payload: dict):
question = payload.get("question", "")
answer = rag.generate_answer(question)
return {"answer": answer}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=7860)