point-median-backend/main.py

23 lines
487 B
Python
Raw Permalink 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
2024-02-19 00:17:05 +00:00
@app.post("/corriger")
2023-09-14 15:21:42 +00:00
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