feat: add Gemini text-to-speech service#134
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opened on behalf of Onur Solmaz (
osolmaz).Summary
Gemini text-to-speech can now be used as a Manim Voiceover service.
This rebases and completes the Gemini service work from #119 on the current package layout.
It adds the service, documents both API-key and ADC authentication, updates the main demo to render with Gemini, and adds typed tests around the SDK boundary.
What Changed
The new service follows the existing Manim Voiceover service shape while keeping Google SDK details isolated at the boundary.
It supports Gemini Developer API keys by default and Vertex/ADC authentication when requested.
GeminiServicewith configurable model, voice, authentication mode, project, and location.geminioptional dependency forgoogle-genaion supported Python versions.CodeAPI.Testing
The local gates passed, including the demo compile check requested before merge.
The main demo also rendered locally with Gemini ADC credentials and produced
media/videos/voiceover-demo/480p15/VoiceoverDemo.mp4.uv run ruff format --check .uv run ruff check .uv run ty check src/manim_voiceoveruv run mypyuv run pytest --cov=manim_voiceover --cov-fail-under=85uv run python -m compileall -q examplesuv run pytest tests/test_examples_render.py -quv run manim -ql examples/voiceover-demo.py VoiceoverDemouv run python -m compileall -q src/manim_voiceover tests examplesuv builduv run pip-audituvx slophammer-py@0.3.0 dry .uvx slophammer-py@0.3.0 check .PATH="$PWD/.venv/bin:$PATH" uvx slophammer-py@0.3.0 check . --executeRisks
The main risk is Google SDK/API drift because Gemini TTS preview models can change over time.
The code keeps SDK access in one service module and covers malformed responses in tests.
Supersedes #119.