15 lines
411 B
Python
15 lines
411 B
Python
from fastapi import FastAPI
|
|
from app.dependencies import api_key_middleware
|
|
from models.prediction import PredictionRequest
|
|
from services.disease_predictor import DiseasePredictor
|
|
|
|
app = FastAPI()
|
|
|
|
app.middleware("http")(api_key_middleware)
|
|
|
|
|
|
@app.post("/predict")
|
|
async def make_prediction(request: PredictionRequest):
|
|
predictor = DiseasePredictor("dataset.csv")
|
|
return predictor.predict(request.text)
|