Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the dedicated imagen model implementation, configuration schemas, and exports from the genkit-google-genai package. Imagen models are now classified as unsupported, and the system redirects users to use gemini_image_model() for image generation instead. Feedback on the changes suggests refactoring the unsupported model error handling in _model_refs.py to avoid redundant string formatting when suggesting the alternative image generation method.
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.
Closes #6176
Summary
Removes Imagen from the Python google-genai plugin.
models/imagen.pyis deleted along withImagenVersion,KnownImagen,ImagenConfigSchema,ImagenModel, and theimagen_modelconstructors onGoogleAIandVertexAI. This is a breaking change to the package's public exports.An
imagen-id now fails closed on both plugins:ai.generatereports the model as not found instead of falling through to a Gemini text model, and every typed ref constructor rejects it with a hint pointing atgemini_image_model. Model discovery never registersimagen-*entries the API may still list.The
vertexai-imagensample and its workspace entry are removed. The image flow ingoogle-genai-medianow targetsgoogleai/gemini-2.5-flash-image. Removing the workspace member invalidateduv.lock, souv lockre-emitted a few redundant environment markers in their current form; no dependency versions changed.Also resolves the
ImagenConfigSchemabullet of #6185. JS and Go still list the Imagen 4 ids and are out of scope here.The new fail-closed and discovery tests were run against the parent commit's source and fail there.
Also, the Vertexai sample folder is still named
vertexai-imagen. Renaming it would touch the root workspace config, the samples index, and possibly CI matrices, which is wider than this change, so I left it (can be a follow-up issue).