test(pydantic_ai): Fix instructions test for pydantic-ai >=2.36.0 - #7321
Open
ericapisani wants to merge 3 commits into
Open
test(pydantic_ai): Fix instructions test for pydantic-ai >=2.36.0#7321ericapisani wants to merge 3 commits into
ericapisani wants to merge 3 commits into
Conversation
Build the agent with public `instructions`/`system_prompt` kwargs instead of poking internal `_instructions`/`_system_prompts` attributes, and account for the joiner between multiple instructions changing from a single newline to a blank line in pydantic-ai 2.36.0. Fixes PY-2755 Fixes #7306
Contributor
Codecov Results 📊✅ 121930 passed | ⏭️ 6762 skipped | Total: 128692 | Pass Rate: 94.75% | Execution Time: 437m 25s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2482 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 90.28% 90.31% +0.03%
==========================================
Files 193 193 —
Lines 25621 25621 —
Branches 9438 9438 —
==========================================
+ Hits 23132 23139 +7
- Misses 2489 2482 -7
- Partials 1436 1436 —Generated by Codecov Action |
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.
Build the agent with public
instructions/system_promptkwargs instead of poking internal_instructions/_system_promptsattributes, and account for the joiner between multiple instructions changing from a single newline to a blank line in pydantic-ai 2.36.0.There's normalization of instructions occurring under the hood as of 2.36.0 that we don't have a reason to interfere with within the tests, so moving the configuration of instructions and the system prompt to using the public
AgentAPI.Fixes PY-2755
Fixes #7306