feat: Add status and error fields to TTS model and implement background processing for TTS generations

This commit is contained in:
JSC
2025-09-21 14:39:41 +02:00
parent b2e513a915
commit 72ddd98b25
6 changed files with 365 additions and 3 deletions

View File

@@ -33,6 +33,8 @@ class TTSResponse(BaseModel):
text: str
provider: str
options: dict[str, Any]
status: str
error: str | None
sound_id: int | None
user_id: int
created_at: str
@@ -81,6 +83,8 @@ async def get_tts_list(
text=tts.text,
provider=tts.provider,
options=tts.options,
status=tts.status,
error=tts.error,
sound_id=tts.sound_id,
user_id=tts.user_id,
created_at=tts.created_at.isoformat(),
@@ -125,6 +129,8 @@ async def generate_tts(
text=tts_record.text,
provider=tts_record.provider,
options=tts_record.options,
status=tts_record.status,
error=tts_record.error,
sound_id=tts_record.sound_id,
user_id=tts_record.user_id,
created_at=tts_record.created_at.isoformat(),