File size: 369 Bytes
81606be
0d5e4b8
81606be
 
 
0d5e4b8
81606be
 
 
 
 
 
 
 
0d5e4b8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastapi import FastAPI, Body
#from llm.model import predict

app = FastAPI()

@app.post("/index")
async def make_prediction(data: dict = Body(...)):
    # Get user input from the request body
    user_input = data["input"]

    # Call the LLM model for prediction
    output = predict(user_input)

    # Return the prediction as JSON
    return {"output": output}