feat: add display_name, model_vendor, and model_version metadata

This commit is contained in:
Nik
2026-01-05 11:01:36 -08:00
parent 3b847e0d9d
commit 13db8e10dc
3 changed files with 5566 additions and 1369 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,57 @@
"""
Tests to validate model_prices_and_context_window.json metadata fields.
Ensures all model entries have required metadata fields:
- display_name: Human-readable name
- model_vendor: Vendor/provider identifier (e.g., "openai", "anthropic", "meta")
"""
import json
import pytest
from pathlib import Path
@pytest.fixture(scope="module")
def model_prices_data():
"""Load the model prices JSON file."""
possible_paths = [
Path(__file__).parent.parent.parent.parent / "model_prices_and_context_window.json",
Path("model_prices_and_context_window.json"),
]
for path in possible_paths:
if path.exists():
with open(path, "r") as f:
return json.load(f)
pytest.fail("Could not find model_prices_and_context_window.json")
class TestModelMetadataPresence:
"""Test that required metadata fields are present."""
def test_all_models_have_display_name(self, model_prices_data):
"""Every model entry should have a display_name."""
missing = []
for model_key, model_data in model_prices_data.items():
if "display_name" not in model_data:
missing.append(model_key)
if missing:
pytest.fail(
f"Missing display_name in {len(missing)} models. "
f"First 10: {missing[:10]}"
)
def test_all_models_have_model_vendor(self, model_prices_data):
"""Every model entry should have a model_vendor."""
missing = []
for model_key, model_data in model_prices_data.items():
if "model_vendor" not in model_data:
missing.append(model_key)
if missing:
pytest.fail(
f"Missing model_vendor in {len(missing)} models. "
f"First 10: {missing[:10]}"
)
+3
View File
@@ -507,6 +507,9 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"additionalProperties": {
"type": "object",
"properties": {
"display_name": {"type": "string"},
"model_vendor": {"type": "string"},
"model_version": {"type": "string"},
"supports_computer_use": {"type": "boolean"},
"cache_creation_input_audio_token_cost": {"type": "number"},
"cache_creation_input_token_cost": {"type": "number"},