Refactor/centralize vertex ai version config#924
Refactor/centralize vertex ai version config#924calebjubal wants to merge 5 commits intoGoogleCloudPlatform:mainfrom
Conversation
|
awaemmanuel
left a comment
There was a problem hiding this comment.
Hi,
Thank you so much this PR.
Good Points
- Centralizing
VERTEX_API_VERSIONinconfig/default.pyallows for easier upgrades and environment-based configuration. - Updates to other files (models/character_consistency.py, models/image_models.py, etc.) correctly implement the new configuration.
Minor Nits
- In
config/default.py,the comment#Vertex AIcould use a space:# Vertex AI.
Recommendation
Request Changes. The PR cannot be merged until the TypeError in models/model_setup.py is resolved.
Before we can merge this change, please fix the TypeError issue in models/model_setup.py. I've given feedback on what to do. Thanks
There was a problem hiding this comment.
Hey @awaemmanuel,
I have added the commits for the two fix issues:
- Spacing between comment hashtag and text.
- Dictionary ( { } ) type acceptance.
Pull-Request Template
Thank you for your contribution! Please provide a brief description of your changes and ensure you've completed the checklist below.
Description
What does this PR do?
Centralizes the Vertex AI API version in [default.py] via a new VERTEX_API_VERSION setting (defaulting to v1beta1).
Updates all Vertex/GenAI client initializations in
models/character_consistency.pymodels/image_models.pymodels/model_setup.pymodels/upscale.pymodels/veo.pyvto.pyto pass
http_options={'api_version': cfg.VERTEX_API_VERSION}(or config.VERTEX_API_VERSION), merging with any existing http_options where needed.Why is it necessary?
Consistency: Previously, the Vertex AI API version was either implicit or scattered; centralizing it avoids subtle mismatches across different model entry points.
Configurability: The API version can now be changed via configuration/environment without code changes, simplifying upgrades and rollbacks when Vertex AI versions change.
Reliability: Explicitly setting the API version reduces risk of breaking changes when the default backend version changes, helping keep all media workflows (Imagen, Veo, VTO, upscaling, character consistency) behaving predictably across environments.
Fixes #913 (if applicable)
Checklist
nox -s formatto format the code.aaie_notebook_template.ipynbif submitting a new jupyter notebook.