File size: 864 Bytes
5a2a999 bd2fb93 6c65b8e 0e27b0f 6c65b8e 0e27b0f 6c65b8e bd2fb93 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
from typing import Any, Callable, Literal
from pydantic import BaseModel, Field
from uuid import UUID
class TransResult(BaseModel):
# trans_pattern: str
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):
# trans_pattern: str
seg_id: int
transcribe_time: float
translate_time:float
context: str = Field(alias="transcribeContent")
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 = {}
# action: str = "recognition"
error_code: int = 0
request_id: UUID |