mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-06 22:17:51 +00:00
fix(models): align Google singleton identity
This commit is contained in:
parent
845d7ea89b
commit
3476bb1ebb
2 changed files with 14 additions and 1 deletions
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
|
|
@ -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 == (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue