mirror of
https://github.com/bellingcat/whisperbox-transcribe.git
synced 2026-06-08 03:28:35 +03:00
42 lines
698 B
Python
42 lines
698 B
Python
import enum
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
from uuid import UUID
|
|
|
|
from pydantic import AnyHttpUrl, BaseModel, Json
|
|
|
|
|
|
class ArtifactType(enum.Enum):
|
|
RawTranscript = "RawTranscript"
|
|
|
|
|
|
class JobType(enum.Enum):
|
|
Transcript = "Transcript"
|
|
|
|
|
|
class JobStatus(enum.Enum):
|
|
Create = "Create"
|
|
Error = "Error"
|
|
Success = "Success"
|
|
|
|
|
|
class WithDbFields(BaseModel):
|
|
id: UUID
|
|
created_at: datetime
|
|
updated_at: Optional[datetime]
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
class Job(WithDbFields):
|
|
status: JobStatus
|
|
type: JobType
|
|
url: AnyHttpUrl
|
|
|
|
|
|
class Artifact(WithDbFields):
|
|
data: Optional[Json]
|
|
job_id: UUID
|
|
type: ArtifactType
|