feat:初版
This commit is contained in:
17
apps/api/app/schemas/translate.py
Normal file
17
apps/api/app/schemas/translate.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class TranslationStyle(str, Enum):
|
||||
literal = "literal"
|
||||
fluent = "fluent"
|
||||
casual = "casual"
|
||||
|
||||
|
||||
class TranslateRequest(BaseModel):
|
||||
source_text: str = Field(..., min_length=1, max_length=10000)
|
||||
source_lang: str = Field(default="auto", max_length=10)
|
||||
target_lang: str = Field(..., max_length=10)
|
||||
style: TranslationStyle = TranslationStyle.literal
|
||||
glossary_id: str | None = None
|
||||
format: str = "text"
|
||||
Reference in New Issue
Block a user