Initial Commit

This commit is contained in:
bladeclara42
2025-05-13 22:43:56 +07:00
commit 5469707c2d
16 changed files with 81 additions and 0 deletions

Binary file not shown.

10
app/api/v1/translate.py Normal file
View File

@@ -0,0 +1,10 @@
from fastapi import APIRouter
from app.models.translation import TranslationRequest, TranslationResponse
from app.services.translator import translate_text
router = APIRouter()
@router.post("/", response_model=TranslationResponse)
async def translate(request: TranslationRequest):
translated_text = await translate_text(request.text, request.target_language)
return TranslationResponse(translated_text=translated_text)