fix(tests): add inference_geo to model prices JSON schema validator#21477
Merged
fix(tests): add inference_geo to model prices JSON schema validator#21477
Conversation
The model_prices_and_context_window_backup.json file has 'inference_geo'
fields (e.g. on 'us/claude-sonnet-4-6') for geo-prefixed Anthropic models
used in cost calculation, but the JSON schema validator in test_utils.py
did not include 'inference_geo' as an allowed property.
This caused test_aaamodel_prices_and_context_window_json_is_valid to fail
with: Additional properties are not allowed ('inference_geo' was unexpected)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummaryThis PR adds the
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| tests/test_litellm/test_utils.py | Adds inference_geo string field to the JSON schema validator for model_prices_and_context_window.json, fixing a ValidationError on geo-prefixed Anthropic models. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["model_prices_and_context_window.json"] -->|contains| B["us/claude-sonnet-4-6\nwith inference_geo: us"]
B -->|validated by| C["test_aaamodel_prices_and_context_window_json_is_valid"]
C -->|uses| D["JSON Schema\nadditionalProperties: false"]
D -->|now includes| E["inference_geo: string ✅"]
B -->|used by| F["anthropic/cost_calculation.py\nprepends geo prefix for cost routing"]
Last reviewed commit: d4755c8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
model_prices_and_context_window_backup.jsonincludesinference_geofields on geo-prefixed Anthropic models (e.g.us/claude-sonnet-4-6) used for cost calculation routingtest_aaamodel_prices_and_context_window_json_is_validhadadditionalProperties: falsebut didn't listinference_geoas an allowed propertyValidationError: Additional properties are not allowed ('inference_geo' was unexpected)"inference_geo": {"type": "string"}to the schemaTest plan
poetry run pytest tests/test_litellm/test_utils.py::test_aaamodel_prices_and_context_window_json_is_valid -vpasses🤖 Generated with Claude Code