tranny / App /Transcription /Schemas.py
Mbonea's picture
ADDED MORE FIELDS
49b4ffb
raw
history blame
944 Bytes
from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime
class TranscriptionMetadata(BaseModel):
duration: int = 0
language: str = "-"
percentage: str = "-"
transcription: dict = {}
state: str = "PENDING"
class BaseTranscription(BaseModel):
created_at: datetime = Field(default_factory=datetime.utcnow)
duration: int = 0
language: str = "-"
file_name: str = "-"
tl_file_id: str = "-"
youtubeLink: str = "-"
task_id: str
transcription_state: str = Field(default="SUCCESS", alias="state")
# content: list = []
class TranscriptionResult(BaseModel):
created_at: datetime = Field(default_factory=datetime.utcnow)
duration: int = 0
language: str = "-"
transcription_state: str = "SUCCESS"
transcript: list = []
@property
def content(self):
return self.transcript
class UserDetails(BaseModel):
userId: str