point-median-backend/main.py

23 lines
486 B
Python
Raw Normal View History

2023-09-14 15:21:42 +00:00
from fastapi import FastAPI
from pydantic import BaseModel
import convertir_point_median as cpm
app = FastAPI()
class TranslationRequest(BaseModel):
text: str
class TranslationResponse(BaseModel):
text: str
@app.get("/corriger")
def translate(request: TranslationRequest):
# Implement Point-Median algorithm here
texte = request.text
texte_corrige = cpm.convertir_point_median(texte)
response = TranslationResponse(text=texte_corrige)
return response