Conversation
There was a problem hiding this comment.
Code Review
This pull request enhances the Gemini and Imagen configuration schemas by introducing detailed Pydantic schemas and JSON schema annotations. Specifically, it adds support for multi-speaker voice configurations and language codes in Gemini TTS, and explicitly defines numerous configuration fields for Imagen (such as aspect ratio, negative prompt, guidance scale, and safety settings). Additionally, the Lyria model module was refactored to only handle model detection, offloading its configuration and version definitions to the interactions module. Comprehensive unit tests were added to validate the new TTS speech configurations, Imagen configuration mapping, and the package's public API surface. I have no feedback to provide as there are no review comments.
0b12e67 to
5c542b2
Compare
5c542b2 to
f9eca64
Compare
… helpers SpeechConfigSchema had no model_config, so extra='ignore' dropped multiSpeakerVoiceConfig, languageCode and every snake_case key including the one our own TTS sample sends. models/lyria.py still carried a second LyriaConfig and LyriaVersion that nothing used now that Interactions owns them; only is_lyria_model is left.
f9eca64 to
05be4cd
Compare
Fixes #6185
Stacked on #6353.
Summary
SpeechConfigSchemahad nomodel_configat all, so beyond the two camelCase fields in the issue it also dropped every snake_case key, including the formpy/samples/google-genai-mediasends for its voice. It now typesvoiceConfig,multiSpeakerVoiceConfigandlanguageCode, matching the SDK'sSpeechConfig, and the five orphanedexclude=Truefields left on it are gone. One behaviour change: an unknown key nested underspeechConfigused to be dropped silently and now raisesINVALID_ARGUMENT, since it reaches the SDK'sextra='forbid'type.models/lyria.pystill carried its ownLyriaConfigandLyriaVersion, unused and now shadowing the Interactions ones that #6241 exports. It keeps onlyis_lyria_model, which routing needs.The issue's
ImagenConfigSchemabullet is covered by #6305 in the base of this stack, which retires Imagen from Python outright.