Skip to content

feat(tools): add Google Lyria and direct Google Veo generation tools#270

Merged
calesthio merged 4 commits into
calesthio:mainfrom
kweinmeister:main
Jul 9, 2026
Merged

feat(tools): add Google Lyria and direct Google Veo generation tools#270
calesthio merged 4 commits into
calesthio:mainfrom
kweinmeister:main

Conversation

@kweinmeister

Copy link
Copy Markdown
Contributor

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 the lyria-3-pro-preview model.

Code Review Fixes

  • Google Credentials (tools/google_credentials.py): Refactored the genai.Client builder under Vertex AI mode to omit the project argument when resolve_project_id() evaluates to None, preventing overriding Application Default Credentials (ADC) automatic project detection.
  • Veo Video (tools/video/veo_video.py):
    • Replaced private SDK attribute checks (client._api_client.vertexai) with the public client.vertexai property getter (with fallback logic for mock environments).
    • Modified _get_image() and reference_to_video to raise FileNotFoundError instead of failing silently or throwing misleading required-parameter errors when local paths are missing.
  • Google Music (tools/audio/google_music.py): Added warning logs when input music duration is under 5 seconds and gets coerced to the 5.0s minimum limit under auto_fix=True (establishing parity with the upper limit warning).

Tests & Documentation

  • Tests (tests/contracts/test_phase3_contracts.py):
    • Added new tests (test_missing_local_image_paths, test_missing_reference_image_paths) verifying correct FileNotFoundError propagation for missing local files.
    • Updated test_minimum_duration_validation to check that the minimum duration warning is logged when duration is coerced.
    • Updated test_vertex_ai_mode_rejection to mock the public client.vertexai property rather than the private client._api_client.vertexai.
  • Documentation (docs/PROVIDERS.md): Documented setup guides, GCP Generative Language API enablement, pricing ($0.08 flat rate), capability mapping, and voice guides for Google tools.

Testing

Verified code changes using local test suites, formatting lints, and static typing analyses:

  1. Unit tests execution:
    uv run pytest tests/contracts/test_phase3_contracts.py -v

  2. Ruff lint checks & formatting:
    uvx ruff check tools/google_credentials.py tools/video/veo_video.py tools/audio/google_music.py
    uvx ruff format tools/google_credentials.py tools/video/veo_video.py tools/audio/google_music.py tests/contracts/test_phase3_contracts.py

  3. Mypy 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=silent

Checklist

  • The change is focused on a single logical concern.
  • I ran the relevant tests locally (make test-contracts / make test) where applicable.
  • I updated docs/README if behavior or usage changed.
  • No unrelated files (build artifacts, local config) are included in the diff.

@kweinmeister kweinmeister requested a review from calesthio as a code owner July 2, 2026 13:19

@calesthio calesthio left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 calesthio left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@calesthio calesthio left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved after addressing the review blocker and the post-Omni CI regression. Current PR head ad02ce3 passes Validate Python.

@calesthio calesthio merged commit 2ab5773 into calesthio:main Jul 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants