video-accessibility/backend/app/core
Vadym Samoilenko c380a96c72 refactor(tts): switch Gemini TTS from AI Studio API to Cloud TTS API
The AI Studio API (generativelanguage.googleapis.com) enforces a hard 10 RPM
quota on preview models regardless of billing tier. Switching to Cloud TTS API
(texttospeech.googleapis.com) with the same Gemini models uses a separate,
production-grade quota that scales on paid plans.

Changes:
- Replace genai.Client + generate_content(AUDIO) with texttospeech.TextToSpeechClient
- Style prompt now goes to SynthesisInput.prompt (dedicated field, not prepended text)
- Speed goes to AudioConfig.speaking_rate (no longer encoded in prompt text)
- Cloud TTS returns MP3 directly — remove PCM→MP3 lameenc conversion
- config: update pro model from gemini-2.5-pro-preview-tts → gemini-2.5-pro-tts (GA)
- Service account already has roles/aiplatform.user (granted today)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 17:16:32 +01:00
..
authz.py fix(auth): await get_redis() coroutine in membership cache 2026-05-08 13:57:57 +01:00
config.py refactor(tts): switch Gemini TTS from AI Studio API to Cloud TTS API 2026-05-08 17:16:32 +01:00
database.py chore: push all session changes — backend hardening, tests, apache config, deploy scripts 2026-04-30 15:52:14 +01:00
dependencies.py chore: push all session changes — backend hardening, tests, apache config, deploy scripts 2026-04-30 15:52:14 +01:00
logging.py initial commit 2025-08-24 16:28:33 -05:00
redis.py initial commit 2025-08-24 16:28:33 -05:00
secrets_config.py chore: push all session changes — backend hardening, tests, apache config, deploy scripts 2026-04-30 15:52:14 +01:00
security.py test: fix all unit tests — 168 passing, 0 failures 2026-04-30 14:02:04 +01:00
seed.py security: remove default admin password fallback (C-04) 2026-04-29 14:12:24 +01:00