Open
Conversation
Python SDK: add contextLength, inputModalities, outputModalities, capabilities; also added tests
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Python SDK’s model metadata surface area to include additional “capability” fields (context length, modalities, capabilities, tool-calling support) and adds tests to ensure these new properties are exposed consistently on both Model and ModelVariant.
Changes:
- Add
context_length,input_modalities,output_modalities,capabilities, andsupports_tool_callingto the PythonIModelinterface and implement them inModel/ModelVariant. - Extend
ModelInfo(Pydantic model) to parse the new metadata fields fromget_model_list. - Add Python tests validating the new properties are present and forwarded correctly (including via
selected_variant).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/test/test_model.py | Adds tests asserting the new metadata properties exist on Model and match the selected ModelVariant. |
| sdk/python/src/model_variant.py | Exposes new metadata properties by forwarding from ModelInfo. |
| sdk/python/src/model.py | Exposes new metadata properties by delegating to the selected variant. |
| sdk/python/src/imodel.py | Extends the IModel ABC with the new metadata properties. |
| sdk/python/src/detail/model_data_types.py | Adds the new fields to ModelInfo with the expected JSON aliases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Python SDK: add contextLength, inputModalities, outputModalities, capabilities; also added tests for these fields
Added a test for modelVariant as well