Conversation
…hemas The upstream zerodep fix (jsonschema 0.4.1) makes the resolve_refs → merge_allof → sanitize bypass unnecessary — flatten_schema now preserves multi-branch unions natively. Restore _simplify_nullable_schemas to its original non-recursive form since the upstream pipeline handles nested schemas.
Preserves multi-branch anyOf/oneOf unions instead of collapsing to the first non-null branch. Upstream: Oaklight/zerodep#173
Cover str|int, single nullable collapse, and get_schema() pipeline for multi-branch unions across openai-chat and anthropic formats.
- Add --extra-index-url for TestPyPI so CI can resolve dev releases - Bump llm-rosetta dependency to pick up the union-preservation fix (Oaklight/llm-rosetta#747) - Remove xfail marker from test_get_schema_preserves_multi_union
This branch has not been deployed
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
anyOf/oneOfbranches (e.g.,float | list[float] | None) instead of collapsing to the first non-null branchtupleannotations totuple[Any, ...]so they render as{type: "array"}instead of{}_resolve_enum()to handle PEP 604X | Yunions (types.UnionType)Cherry-picks @rajeeva's initial fix from #270, then layers upstream corrections on top. The core schema flattening fix lives in zerodep (Oaklight/zerodep#173) and llm-rosetta (Oaklight/llm-rosetta#747); this PR vendors the zerodep fix and adds toolregistry-specific improvements (bare tuple normalization, PEP 604 enum resolution).
Fixes #269.
Supersedes #270.
Test plan
pytest tests/test_schema_sanitization.py— 25 passed, 1 xfail (xfail depends on llm-rosetta#747)pytest tests/test_parameter_models.py— 48 passedanyOfoutput