init: new structure + fix lint errors

This commit is contained in:
Daniil
2026-02-03 02:15:07 +03:00
commit 67e0f22b4f
89 changed files with 7654 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
from __future__ import annotations
import httpx
from cpv3.infrastructure.settings import get_settings
from cpv3.modules.transcription.schemas import Document
async def generate_captions(
*, video_s3_path: str, folder: str, transcription: Document
) -> str:
"""Generate captions for a video using the Remotion service."""
settings = get_settings()
payload = {
"folder": folder,
"videoSrc": video_s3_path,
"transcription": transcription.model_dump(),
}
async with httpx.AsyncClient(timeout=300) as client:
resp = await client.post(
f"{settings.remotion_service_url}/api/render", json=payload
)
resp.raise_for_status()
data = resp.json()
if not isinstance(data, dict) or "output" not in data:
raise RuntimeError("Unexpected response from remotion service")
return str(data["output"])