feat(py/plugins/google-genai): Support tuned Gemini endpoint models#5182
Draft
cabljac wants to merge 2 commits into
Draft
feat(py/plugins/google-genai): Support tuned Gemini endpoint models#5182cabljac wants to merge 2 commits into
cabljac wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for Vertex AI tuned Gemini endpoints to the Google GenAI plugin. It introduces helper functions to identify and resolve tuned endpoint names, ensuring short-form identifiers are correctly expanded to full resource paths for the SDK. The model resolution logic was updated to integrate these endpoints, and comprehensive tests were added. Feedback was provided to improve the robustness of the resource path validation by ensuring the presence of the location segment in fully qualified names.
Accepts Vertex AI tuned endpoints addressed either by the short form `endpoints/ID` or the full resource path `projects/PROJECT/locations/LOCATION/endpoints/ID`. - gemini.py gains is_tuned_gemini_name() and resolve_vertex_model_name() helpers; both generate_content call sites wrap the model name through the latter so the SDK receives a fully qualified path and skips its default publishers/google/models/ prefixing. - VertexAI._resolve_model routes tuned endpoint names through GeminiModel with the standard Gemini config schema and a sensible label. - Skip list_actions injection — tuned endpoints are private and not publicly listable. - Mirrors the Go PR #5178 design and the JS behaviour in js/plugins/google-genai/src/vertexai/client.ts. - Adds a unit test file covering both helpers and all dispatch paths.
e537e69 to
f3ea96e
Compare
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.
Accepts Vertex AI tuned Gemini endpoints addressed either by the short form
endpoints/IDor the fully qualifiedprojects/PROJECT/locations/LOCATION/endpoints/ID.is_tuned_gemini_name()andresolve_vertex_model_name()helpers ingemini.pyhandle the classification and path expansion; bothgenerate_contentcall sites wrap the model name through the resolver so the SDK receives a fully qualified path and skips its defaultpublishers/google/models/prefix.VertexAI._resolve_modelroutes these names throughGeminiModel.Mirrors Go PR #5178 and the JS behaviour in
js/plugins/google-genai/src/vertexai/client.ts.Testing