法语翻译修复

This commit is contained in:
Miyamizu-MitsuhaSang 2025-11-08 22:33:59 +08:00
parent e30b0c081e
commit 294b1353cc
2 changed files with 2 additions and 4 deletions

View File

@ -15,8 +15,6 @@ from settings import settings
translator_router = APIRouter()
# For list of language codes, please refer to `https://api.fanyi.baidu.com/doc/21`
from_lang = 'en'
to_lang = 'zh'
# endpoint = 'https://api.fanyi.baidu.com'

View File

@ -5,8 +5,8 @@ from pydantic import BaseModel, field_validator, model_validator
class TransRequest(BaseModel):
query: str
from_lang: Literal['auto', 'fr', 'jp', 'zh', 'en'] = 'auto'
to_lang: Literal['fr', 'jp', 'zh', 'en'] = 'zh'
from_lang: Literal['auto', 'fra', 'jp', 'zh', 'en'] = 'auto'
to_lang: Literal['fra', 'jp', 'zh', 'en'] = 'zh'
@field_validator('from_lang', 'to_lang')
@classmethod