feat: add extract_function_schema with primitive type support#2590
Draft
andeplane wants to merge 1 commit into
Draft
feat: add extract_function_schema with primitive type support#2590andeplane wants to merge 1 commit into
andeplane wants to merge 1 commit into
Conversation
Ports the Python script schema generator into the SDK as a pure-Python, no-network utility. This PR establishes the module skeleton, dataclasses, AST helpers, validation, and primitive type support (str, int, float, bool). - New module: cognite/client/_api/ai/python_schema.py - New tests: tests/tests_unit/test_api/test_python_schema.py (us1 group) - pyproject.toml: adds griffe>=1.0,<2 and jsonschema>=4.0,<5 as optional deps under a new [schema] extra - pytest.ini: registers us1/us2/us3 markers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
extract_function_schema)SchemaResult,ErrorResult), AST helpers, and validationstr,int,float,bool(scalars andlist[T]variants)NodeId,datetime,DataFrame) and docstring enrichment come in PR 2/3Changes
cognite/client/_api/ai/python_schema.py— new moduletests/tests_unit/test_api/test_python_schema.py— 12 tests (all marked@pytest.mark.us1)pyproject.toml— addsgriffe>=1.0,<2andjsonschema>=4.0,<5as optional deps under a newschemaextrapytest.ini— registersus1/us2/us3markersTest plan
pytest tests/tests_unit/test_api/test_python_schema.py -k us1— all greenStack
🤖 Generated with Claude Code