video-accessibility/backend/app/prompts
michael e44210ea64 feat: auto-rewrite TTS cues that fail synthesis
When TTS synthesis fails after 3 retries, the system now:
- Sends problematic cue text to Gemini for TTS-safe rewriting
- Updates the VTT file in GCS with rewritten text
- Retries TTS synthesis with the new text
- Records successful rewrites in job.tts_rewrites field

UI changes:
- JobDetail shows amber caution box with original/rewritten text
- JobsList shows warning icon next to jobs with rewrites
- Error display clarifies text shown is "after rewrite attempt"

Files changed:
- backend/app/models/job.py: Add tts_rewrites field
- backend/app/prompts/gemini_tts_rewrite.md: New prompt template
- backend/app/services/gemini.py: Add rewrite_tts_cue method
- backend/app/tasks/tts_synthesis.py: Add VTT update utilities
- backend/app/tasks/translate_and_synthesize.py: Rewrite+retry logic
- frontend/src/types/api.ts: Add TTSRewriteItem type
- frontend/src/routes/jobs/JobDetail.tsx: Caution display
- frontend/src/routes/jobs/JobsList.tsx: Warning indicator

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 14:42:50 -06:00
..
gemini_accessible_video.md feat: improve pause point precision with sentence boundary detection 2025-12-28 14:41:12 -06:00
gemini_ingestion.md fix: generate audio descriptions in the video's detected language 2025-12-22 19:01:14 -06:00
gemini_ingestion_targeted.md feat: add video-native translation mode for multi-language content 2025-12-31 13:50:05 -06:00
gemini_transcreation.md initial commit 2025-08-24 16:28:33 -05:00
gemini_tts_rewrite.md feat: auto-rewrite TTS cues that fail synthesis 2026-01-05 14:42:50 -06:00