Add api_version field to Gemini to support stable Vertex AI v1 API - #6711
Open
guptaishaan wants to merge 1 commit into
Open
Add api_version field to Gemini to support stable Vertex AI v1 API#6711guptaishaan wants to merge 1 commit into
api_version field to Gemini to support stable Vertex AI v1 API#6711guptaishaan wants to merge 1 commit into
Conversation
ADK currently hard-codes `v1beta1` as the Vertex AI API version for all Gemini Signed-off-by: Ishaan <ishaangupta0408@gmail.com>
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.
ADK currently hard-codes
v1beta1as the Vertex AI API version for all Geminirequests, including both
generate_contentand live-connect paths. This meansproduction workloads running on GA models (e.g. Gemini 2.5 Pro) are still
hitting a beta endpoint, which is outside the Vertex AI Gemini SLA.
This PR adds an
api_versionfield to theGeminimodel class. When set itoverrides both the version inferred from a
base_urlsuffix and theper-backend defaults (
v1beta1for Vertex AI,v1alphafor Gemini API). Thefield flows automatically into
api_client,_live_api_client, and everygenerate_content/connectcall via the existing_base_url_and_api_version/
_live_api_versionmachinery.Users can opt into the stable endpoint with:
Three regression tests are added to
test_google_llm.pycovering the overrideat the live-version, base-url-conflict, and api-client levels.
Fixes #3246