Repository navigation
Conversation
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.
What
structured()andstreaming_structured()now treat everything before the parser as the model, so the parse-and-retry wrapper applies to langchain-openai 1.7's three-step chain (model, refusal check, parser).Why
CI started failing (20 unit tests,
test (3.12),test (3.13),integration) after dependencies moved to langchain-core 1.7.5 / langchain-openai 1.7.4. It is not pydantic 2.14:ValidationErroris still aValueErrorthere. langchain-openai 1.7 inserts a_check_refusalstep between the model and the parser, so_split(which required exactly two steps) returned None, the retry wrapper was skipped, and a bad answer'sValidationErrorescaped instead of being retried. The extra steps run directly under the caller's run (not as a nested sequence) so the trace still attaches the parsed answer to the model call.How to test
pytest packages/nl2sql/tests/unit/test_parse_and_retry.py test_chat_tools.py test_conversations.py test_engine_events.py test_cost_and_caps.py test_limits_and_join_keys.py test_llm_providers_v2.py. Passes on pydantic 2.14.2 + langchain-openai 1.7.4 and on pydantic 2.13.5 + langchain-openai 1.6.2.Checklist