Adinarayana02's picture
Create app.py
0ac05a0 verified
raw
history blame
404 Bytes
from fastapi import FastAPI
from app.rag import generate_response
from app.classification import classify_text
app = FastAPI()
@app.post("/rag")
async def rag_endpoint(prompt: str):
response = generate_response(prompt)
return {"response": response}
@app.post("/classification")
async def classification_endpoint(text: str):
category = classify_text(text)
return {"category": category}