| | from typing import Any, Callable, Literal |
| | from pydantic import BaseModel, Field |
| | from uuid import UUID |
| |
|
| | class TransResult(BaseModel): |
| | |
| | seg_id: int |
| | context: str |
| | from_: str = Field(alias="from") |
| | to: str |
| | tran_content: str = Field(alias="tranContent") |
| | partial: bool = True |
| |
|
| | class Config: |
| | populate_by_name = True |
| |
|
| |
|
| | class DebugResult(BaseModel): |
| | |
| | seg_id: int |
| | transcrible_time: float |
| | translate_time:float |
| | context: str = Field(alias="transcribleContent") |
| | from_: str = Field(alias="from") |
| | to: str |
| | tran_content: str = Field(alias="translateContent") |
| | partial: bool = True |
| |
|
| | class Config: |
| | populate_by_name = True |
| |
|
| |
|
| |
|
| |
|
| | class Message(BaseModel): |
| | result: TransResult = {} |
| | |
| | error_code: int = 0 |
| | request_id: UUID |