pc translate sentences

This commit is contained in:
2026-10-08 10:08:16 +08:00
parent b28f809c46
commit 4746331515
8 changed files with 714 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ class SentenceBoundaryDocument(BaseModel):
return self
VideoStatus = Literal["uploaded", "processing", "ready", "failed"]
VideoStatus = Literal["uploaded", "processing", "ready", "failed", "local_subtitles"]
class VideoSummary(BaseModel):
@@ -144,6 +144,16 @@ class SubtitleTranslationResponse(BaseModel):
error: Optional[str] = None
class LocalSubtitleTranslationRequest(BaseModel):
"""Upload locally generated English subtitles so the server can translate them."""
model_config = ConfigDict(extra="forbid")
duration_ms: int = Field(gt=0)
algorithm_version: str = Field(default="local-pc", min_length=1, max_length=64)
sentences: List[SentenceBoundary] = Field(min_length=1)
class TranslationTerm(BaseModel):
model_config = ConfigDict(extra="forbid")