File size: 406 Bytes
d657608
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11576c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from fastapi import FastAPI, Request
from pydantic import BaseModel

app = FastAPI()

class PredictRequest(BaseModel):
    text: str

@app.post("/predict")
def predict(req: PredictRequest):
    # Dummy implementation for testing
    # Replace with your model inference logic
    if "alarm" in req.text.lower():
        intent = "set_alarm"
    else:
        intent = "unknown"
    return {"intent": intent}