- Notifications
You must be signed in to change notification settings - Fork 1.5k
Make end_strategy also work for output tools, not just tools #3523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 17 commits
Commits
Show all changes
69 commits Select commit Hold shift + click to select a range
1d2a547 Make `end_strategy` also work for output tools, not just tools
Danipulok b3371e5 Fix tests
Danipulok c5bfc1b Fix lints
Danipulok 7856ce7 Add missing coverage
Danipulok 52d6a4c Update tests to use snapshot
Danipulok 9a27360 Refactor duplicated code
Danipulok 4a1a34e Fix typecheck errors
Danipulok 3a0fd30 Merge branch 'main' into feat/end-strategy
Danipulok 95d979e Merge branch 'main' into feat/end-strategy
Danipulok 542a234 feat: Support exhaustive end_strategy for output tools with validation
Danipulok 9841ee6 Fix comments
Danipulok c6f09e3 Add tests (WIP)
Danipulok 8cdeb27 Move related tests to a `TestMultipleToolCalls` to mirror `test_agent…
Danipulok 7fda323 Use `ErrorDetails` instead of raw dict
Danipulok 4453fdc Use `ErrorDetails` instead of raw dict
Danipulok 0cb7ddd Docs: remove unnecessary clarification
Danipulok 1d8727e Tests: fix `test_early_strategy_does_not_apply_to_tool_calls_without_…
Danipulok 46356a9 Tests: remove unneeded `part_kind`
Danipulok c61a0de Merge branch 'main' into feat/end-strategy
Danipulok 5a7de7d Tests: update comment for `test_early_strategy_with_external_tool_call`
Danipulok 6e99104 Docs: update docs
Danipulok 7cdcb6b Coverage: trying to make it work
Danipulok f8d6200 Tests: add tests
Danipulok e1ea66f Tests: add note about tests
Danipulok b5d5ae0 Tests: add note about tests
Danipulok 5acaebb Merge branch 'main' into feat/end-strategy
Danipulok 0776b75 Tests: fix imports
Danipulok 5323cb5 Update docs/tools-advanced.md
Danipulok d5af8bc Update docs/output.md
Danipulok eb18933 Tests: compare with all messages, and not just the latest part
Danipulok 7b62ffa Tests: compare with all messages, and not just the latest part
Danipulok 8b9abaf Tests: make test similar with `test_agent`
Danipulok 9ff103e Tests: move `OutputType` to a global type
Danipulok 4fed107 Tests: mirror `test_exhaustive_strategy_executes_all_tools`
Danipulok c6568d5 Tests: mirror `test_exhaustive_strategy_calls_all_output_tools`
Danipulok b7a641e Tests: mirror `test_early_strategy_does_not_call_additional_output_to…
Danipulok 07efa5b Tests: mirror `test_exhaustive_strategy_invalid_first_valid_second_ou…
Danipulok ba5b212 Tests: mirror `test_exhaustive_strategy_valid_first_invalid_second_ou…
Danipulok e0b1662 Tests: mirror `test_early_strategy_with_final_result_in_middle`
Danipulok 1b55376 Tests: mirror `test_exhaustive_raises_unexpected_model_behavior`
Danipulok 74be45b Tests: mirror `test_multiple_final_result_are_validated_correctly`
Danipulok cd49935 Tests: mirror `test_early_strategy_with_external_tool_call`
Danipulok 29ceecb Tests: mirror `test_early_strategy_with_deferred_tool_call`
Danipulok 7c88c48 Docs: update docs
Danipulok 636a646 Ruff: fix
Danipulok fb575d6 Docs: fix note
Danipulok 60613bc Tests: add `# pragma: no cover`
Danipulok 31b62e6 Tests: replace `mark.xfail` with `mark.skip` to "fix" coverage
Danipulok ceabae5 Tests: add comments and assert to a tool
Danipulok 817e662 Code: add `raise e`
Danipulok e100275 Code: remove `raise e`
Danipulok ea10210 Tests: add `@pytest\.mark\.skip` and `@pytest\.mark\.xfail` to skip c…
Danipulok aa16a41 Tests: add `test_exhaustive_strategy_with_tool_retry_and_final_result…
Danipulok d11b820 Docs: add mentioning of `end_strategy` in `Agent`
Danipulok b2fe5da Merge branch 'pydantic:main' into feat/end-strategy
Danipulok 0bf5414 Merge branch 'feat/end-strategy' of github.com:Danipulok/pydantic-ai …
Danipulok c4bf11b Update docs/output.md
Danipulok f9c05de Update docs/output.md
Danipulok 06dd066 Update docs/tools-advanced.md
Danipulok cc01098 Merge branch 'pydantic:main' into feat/end-strategy
Danipulok 109b11b Tests: order tests better
Danipulok 081da9a Docs: improve `agents.md`
Danipulok aa37dcb Docs: change `EndStrategy` docs
Danipulok ac391b3 Docs: change `Output Tool Calls` docs
Danipulok 71691f5 Graph: change logic of handling failed output tools when final result…
Danipulok 09799d4 Tests: add note about changing tests
Danipulok 05af1d7 Tweak docs
DouweM aae0c1f Update pydantic_ai_slim/pydantic_ai/agent/__init__.py
Danipulok a74a767 Graph: change line to `Output tool not used - output failed validation.`
Danipulok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.