heeba001's picture
Update app.py
4300ca5 verified
Raw History Blame Contribute Delete
336 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
from utils import analyze_text
app = FastAPI(title="AFCON Topic + Sentiment API")
class InputText(BaseModel):
text: str
@app.get("/")
def health():
return {"status": "ok"}
@app.post("/analyze")
def analyze(payload: InputText):
return analyze_text(payload.text)