From 3476bb1ebb1829e2849485e04793dfbef39ee797 Mon Sep 17 00:00:00 2001 From: RaresKeY <158580472+RaresKeY@users.noreply.github.com> Date: Sat, 18 Jul 2026 13:08:24 +0000 Subject: [PATCH] fix(models): align Google singleton identity --- src/model_capability_readers/google.py | 6 +++++- tests/test_provider_capability_schemas.py | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/model_capability_readers/google.py b/src/model_capability_readers/google.py index 9edb57bdb..498baddd3 100644 --- a/src/model_capability_readers/google.py +++ b/src/model_capability_readers/google.py @@ -20,7 +20,11 @@ vendor = VENDOR_GOOGLE def _model_items(payload: Mapping[str, Any]) -> tuple[Mapping[str, Any], ...]: models = payload.get("models") if isinstance(payload, Mapping) else None - if models is None and isinstance(payload, Mapping) and payload.get("name"): + if ( + models is None + and isinstance(payload, Mapping) + and ai_studio.google_model_id(payload) + ): models = [payload] return tuple(item for item in as_list(models) if isinstance(item, Mapping)) diff --git a/tests/test_provider_capability_schemas.py b/tests/test_provider_capability_schemas.py index f83c104cd..bf814d678 100644 --- a/tests/test_provider_capability_schemas.py +++ b/tests/test_provider_capability_schemas.py @@ -666,6 +666,13 @@ def test_native_singleton_and_bare_list_shapes_reach_their_readers(): }, vendor="google", ) + google_base_id_records = records_from_payload( + { + "baseModelId": "gemini-base-only", + "supportedGenerationMethods": ["embedContent"], + }, + vendor="google", + ) huggingface_records = records_from_payload( [{"modelId": "org/model", "pipeline_tag": "text-generation"}], vendor="huggingface", @@ -687,6 +694,8 @@ def test_native_singleton_and_bare_list_shapes_reach_their_readers(): assert google_records[0].catalog_shape_id == ( "google.generative-language.model.v1beta" ) + assert google_base_id_records[0].model_id == "gemini-base-only" + assert google_base_id_records[0].capability.family == mc.FAMILY_EMBEDDING assert huggingface_records[0].model_id == "org/model" assert huggingface_records[0].capability.family == mc.FAMILY_CHAT assert huggingface_records[0].catalog_shape_id == (