Spaces:
Sleeping
Sleeping
Commit History
-
Add async REST job API alongside the existing Gradio UI
Mirrors HuggingFaceSpaces/ArchiveAI-STT's server/api_jobs.py pattern: POST /api/jobs, GET /api/jobs/{id}, GET /api/jobs, GET /api/status, POST /api/drain, GET /api/ping, plus GET /api/projects and GET /api/projects/{id} for an external caller to poll for edits made through the UI (project updated_at changes on every UI edit). Prerequisite refactor: extracted the actual ElevenLabs call (_synthesize_turn_and_store) out of app.py into tts/core/turn_audio.py (synthesize_turn) and tts/core/turns.py (build_project_payload), so both the Gradio UI and the new API can call the same pure functions without either module importing from the other. app.py's version is now a thin wrapper that adds its Gradio-state-specific segment mutation on top. Existing tests patching the old app.synthesize_turn_audio location were updated to patch tts.core.turn_audio.synthesize_turn_audio instead; all 443 pre-existing tests still pass unchanged in behavior. A submitted job runs the same pipeline Turn Review's U…ab0a768