feat(tools): add Google Lyria and direct Google Veo generation tools#270
Conversation
calesthio
left a comment
There was a problem hiding this comment.
Thank you for the contribution. This is a useful capability addition: Lyria fills the music-generation gap under the existing Google credential surface, and the direct Google Veo path plus credential fixes are covered by focused contract tests.\n\nVerification I ran:\n\n\\ ext\npython -m py_compile tools/audio/google_music.py tools/video/veo_video.py tools/google_credentials.py tools/audio/google_tts.py tools/graphics/google_imagen.py\npython -m pytest tests/contracts/test_phase3_contracts.py -q\n# 84 passed in 98.15s\n\\n\nI also confirmed the registry discovers \google_music\ under \music_generation\ and keeps \�eo_video\ discoverable under \�ideo_generation. I did not find an actionable security issue in the reviewed diff.
calesthio
left a comment
There was a problem hiding this comment.
I need to revise my earlier approval after checking the GitHub Actions failure. The current branch is not merge-ready because CI is failing on a clean install.
The failing check is Validate Python on run https://github.com/calesthio/OpenMontage/actions/runs/28796969159. The test step fails with 12 failures, all rooted in the missing Google GenAI SDK dependency:
ModuleNotFoundError: No module named 'google.genai'
AttributeError: module 'google' has no attribute 'genai'
Examples from the failed suite:
FAILED tests/contracts/test_phase3_contracts.py::TestGoogleCredentials::test_get_genai_client_with_google_api_key
FAILED tests/contracts/test_phase3_contracts.py::TestGoogleMusic::test_duration_validation
FAILED tests/contracts/test_phase3_contracts.py::TestVeoVideo::test_duration_coercion
FAILED tests/contracts/test_phase3_contracts.py::TestVeoVideo::test_missing_local_image_paths
FAILED tests/contracts/test_phase3_contracts.py::TestVeoVideo::test_missing_reference_image_paths
I checked the PR diff and dependency files: this PR adds code/tests that import from google import genai and from google.genai import types, but it does not update requirements.txt / requirements-dev.txt to install google-genai. CI installs with make install-dev, so the package is absent in GitHub Actions even if it happened to be present in my local review environment.
Please add the required dependency in the appropriate requirements file and rerun CI. If google-genai is intended to remain optional at runtime, the tests still need to mock/stub that dependency so the clean CI environment can exercise the contract without requiring an unlisted package.
I did not find an actionable security issue in the reviewed diff, but the current CI failure is a merge blocker.
Summary
This PR integrates the Google Lyria music generation tool (
google_music) and adds a direct Google API backend/gateway for Google Veo video generation (veo_video). This ensures consistent credential resolution, client initialization, and SDK property access patterns across all Google GenAI SDK tools in the codebase.Changes
New Features & Tools
google_music(tools/audio/google_music.py): Added Google Lyria music generation capability supporting up to 184 seconds of stereo audio via thelyria-3-pro-previewmodel.Code Review Fixes
genai.Clientbuilder under Vertex AI mode to omit theprojectargument whenresolve_project_id()evaluates toNone, preventing overriding Application Default Credentials (ADC) automatic project detection.client._api_client.vertexai) with the publicclient.vertexaiproperty getter (with fallback logic for mock environments)._get_image()andreference_to_videoto raiseFileNotFoundErrorinstead of failing silently or throwing misleading required-parameter errors when local paths are missing.auto_fix=True(establishing parity with the upper limit warning).Tests & Documentation
test_missing_local_image_paths,test_missing_reference_image_paths) verifying correctFileNotFoundErrorpropagation for missing local files.test_minimum_duration_validationto check that the minimum duration warning is logged when duration is coerced.test_vertex_ai_mode_rejectionto mock the publicclient.vertexaiproperty rather than the privateclient._api_client.vertexai.Testing
Verified code changes using local test suites, formatting lints, and static typing analyses:
Unit tests execution:
uv run pytest tests/contracts/test_phase3_contracts.py -vRuff lint checks & formatting:
uvx ruff check tools/google_credentials.py tools/video/veo_video.py tools/audio/google_music.pyuvx ruff format tools/google_credentials.py tools/video/veo_video.py tools/audio/google_music.py tests/contracts/test_phase3_contracts.pyMypy type checking:
uv run mypy tools/google_credentials.py tools/video/veo_video.py tools/audio/google_music.py --ignore-missing-imports --disable-error-code import-untyped --follow-imports=silentChecklist
make test-contracts/make test) where applicable.