fix: accept JSON schemas in structured output parser - #1125
Open
Iams4kura wants to merge 1 commit into
Open
Conversation
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
Regression evidence
Before:
PYTHONDONTWRITEBYTECODE=1 uv run --frozen pytest -o addopts='' -p no:cacheprovider tests/utils/output_parser_test.py::test_structured_output_parser_accepts_json_schema -qexited1After:
PYTHONDONTWRITEBYTECODE=1 uv run --frozen pytest -o addopts='' -p no:cacheprovider tests/utils/output_parser_test.py::test_structured_output_parser_accepts_json_schema -qexited0Verification
PYTHONDONTWRITEBYTECODE=1 .venv/bin/pytest -o addopts='' -p no:cacheprovider tests/utils/output_parser_test.py -qPYTHONDONTWRITEBYTECODE=1 .venv/bin/pytest -o addopts='' -p no:cacheprovider tests/test_json_scraper_graph.py -q.venv/bin/ruff check scrapegraphai/utils/output_parser.py tests/utils/output_parser_test.py.venv/bin/black --check scrapegraphai/utils/output_parser.py tests/utils/output_parser_test.py.venv/bin/isort --check-only scrapegraphai/utils/output_parser.py tests/utils/output_parser_test.pyuv build --no-sourcesoffline ChatOpenAI.with_structured_output JSON Schema contract checkScope
Local full-suite note
I also attempted the repository CI selection,
uv run pytest tests/ -m "unit or not integration". It reached 95% with unrelated live-provider, browser, network, and existing assertion failures, then was interrupted when an external proxy request stalled. The deterministic affected suites listed above pass.