{"record":{"id":"2b35aa33d46317f4","repo":"agentscope-ai/agentscope","slug":"embedding-model-card-yaml-path-r-is-missing-the","errorCode":null,"errorMessage":"Embedding model card {yaml_path!r} is missing the required top-level 'dimensions' field.","messagePattern":"Embedding model card (.+?) is missing the required top-level 'dimensions' field\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/agentscope/embedding/_embedding_model_card.py","lineNumber":130,"sourceCode":"\n        Merges the base ``parameter_class`` JSON Schema with\n        ``parameter_overrides`` from the YAML — identical to the\n        approach used by :meth:`~agentscope.model.ModelCard.from_yaml`.\n\n        Args:\n            yaml_path (`str`):\n                Path to the YAML file.\n            parameter_class (`Type[BaseModel]`):\n                The ``Parameters`` class from the embedding model subclass.\n\n        Returns:\n            `EmbeddingModelCard`: The loaded model card.\n        \"\"\"\n        with open(yaml_path, \"r\", encoding=\"utf-8\") as f:\n            config = yaml.safe_load(f)\n\n        if \"dimensions\" not in config:\n            raise ValueError(\n                f\"Embedding model card {yaml_path!r} is missing the \"\n                f\"required top-level 'dimensions' field.\",\n            )\n\n        # Build parameter schema from the Parameters class\n        base_schema = parameter_class.model_json_schema()\n        properties = copy.deepcopy(base_schema.get(\"properties\", {}))\n\n        # Apply parameter_overrides (same logic as ModelCard.from_yaml)\n        overrides = config.get(\"parameter_overrides\", {})\n        for param_name, override in overrides.items():\n            if override is None:\n                # null means remove\n                properties.pop(param_name, None)\n                continue\n\n            if isinstance(override, dict):\n                if override.get(\"hidden\"):","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/embedding/_embedding_model_card.py#L112-L148","documentation":"EmbeddingModelCard.from_yaml requires a top-level 'dimensions' key in the YAML model card; without it the card is rejected because model dimensionality cannot be inferred from provider parameters alone.","triggerScenarios":"Calling from_yaml (directly or via list_models) on a card file that lacks the top-level dimensions field.","commonSituations":"Hand-written or third-party model cards missing the field; cards written for an older schema where dimensions were optional; merge/serialization that dropped the key.","solutions":["Add `dimensions: 1024` at the top level of the YAML card","Validate card files in CI with a schema check before shipping them","Regenerate cards from a known-good template that includes dimensions"],"exampleFix":"# before\n# card.yaml\nname: text-embedding-v3\n# after\nname: text-embedding-v3\ndimensions: 1024","handlingStrategy":"validation","validationCode":"import yaml\ncfg = yaml.safe_load(open(path))\nassert \\\"dimensions\\\" in cfg, f\\\"{path} missing dimensions\\\"","typeGuard":null,"tryCatchPattern":"try:\\n    card = EmbeddingModelCard.from_yaml(path)\\nexcept ValueError as e:\\n    if \\\"dimensions\\\" in str(e): patch_card_with_dimensions(path); card = EmbeddingModelCard.from_yaml(path)\\n    else: raise","preventionTips":["Ship card YAMLs from templates containing dimensions","Lint model-card directories in CI"],"tags":["embedding","model-card","yaml","schema-validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}