Skip to content

fix(py/plugins/google-genai): list only callable Vertex embedders#5695

Merged
cabljac merged 1 commit into
mainfrom
fix/py-google-genai-vertex-embedder-listing
Jul 6, 2026
Merged

fix(py/plugins/google-genai): list only callable Vertex embedders#5695
cabljac merged 1 commit into
mainfrom
fix/py-google-genai-vertex-embedder-listing

Conversation

@hilariie

@hilariie hilariie commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What

The Vertex AI plugin discovered embedders by scanning the model catalog for names containing "embedding". Vertex returns its full publisher catalog, including models that are published but not callable in a given project or
region, so this surfaced embedders that fail at call time. For example, vertexai/gemini-embedding-2 was registered and shown in the Dev UI but returned 404 / FAILED_PRECONDITION when invoked.

This change stops discovering Vertex embedders from the catalog and advertises a curated list of known-callable models instead, matching the JS plugin.

Why

Vertex AI's models.list() returns the global publisher catalog and reports supported_actions = None for every entry. Unlike the Gemini API path, the plugin cannot categorize Vertex models by capability, so it fell back to matching the substring "embedding" in the model name. That heuristic cannot tell a model that is listed and callable apart from one that is listed but not callable, so over-listed models leaked into the registry.

The JS plugin already avoids this by not discovery-listing Vertex embedders. It exposes a hand-curated set and keeps resolution permissive. This brings the Python plugin to parity.

How

  • Add VERTEX_KNOWN_EMBEDDERS in models/embedder.py: text-embedding-005,
    text-multilingual-embedding-002, gemini-embedding-001.
  • _list_genai_models no longer collects embedders on the Vertex path.
    Name-matched embedding models are skipped so they also do not leak into the
    Gemini bucket.
  • VertexAI.init, VertexAI._list_known_embedders, and VertexAI.list_actions
    iterate VERTEX_KNOWN_EMBEDDERS instead of discovery output.
  • resolve() is unchanged and stays permissive, so callers can still reference
    any embedder by explicit name, including newly released models that are not in
    the curated list.
  • Update test_vertexai_list_known_embedders to assert the advertised set
    equals the curated list and that a non-callable catalog entry
    (gemini-embedding-2) is never surfaced.

Excluded: multimodalembedding@001

multimodalembedding@001 is deliberately left out. The current Embedder routes every request through the SDK's embed_content, which on Vertex only emits the text-embedder request shape ({'content': ...}) and drops non-text parts. That model rejects that shape, so it cannot be called through this path for either text or media. Proper multimodal support via the :predict endpoint with {text, image, video} instances is tracked in #5649 , which will re-add the model once that path exists.

Testing

  • text-embedding-005, text-multilingual-embedding-002, and
    gemini-embedding-001 verified working against Vertex in the Dev UI.
  • Plugin test suite passes.

Screenshots

Screenshot 2026-07-06 at 12 39 41 Screenshot 2026-07-06 at 12 40 07 Screenshot 2026-07-06 at 12 40 32 Screenshot 2026-07-06 at 12 40 56

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the Vertex AI plugin to use a curated, hardcoded list of verified callable embedders (VERTEX_KNOWN_EMBEDDERS) instead of dynamically discovering them from the Vertex AI catalog, which over-lists non-callable models. The feedback highlights that in the updated unit test, the mock client setup is unused because _list_known_embedders no longer queries the catalog. To make the test meaningful, it is recommended to also verify that the non-callable embedding model is successfully filtered out of the discovered text models list.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread py/plugins/google-genai/test/google_plugin_test.py
@hilariie
hilariie force-pushed the fix/py-google-genai-vertex-embedder-listing branch from 73ba9f1 to 93716bb Compare July 6, 2026 12:03

@cabljac cabljac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@cabljac
cabljac merged commit 367d0e5 into main Jul 6, 2026
24 checks passed
@cabljac
cabljac deleted the fix/py-google-genai-vertex-embedder-listing branch July 6, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants