Spaces:
Sleeping
Sleeping
File size: 369 Bytes
fc399f3 69f514f fc399f3 5190ce9 69f514f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from fastapi import FastAPI
from pydantic import BaseModel
from qabot import llm_chain
app = FastAPI()
@app.get("/")
def health_check():
return {"status": "FastAPI is running!"}
class Query(BaseModel):
query: str
@app.post("/ask")
def ask_question(query: Query):
result = llm_chain.invoke({"query": query.query})
return {"answer": result["result"]}
|