- Notifications
You must be signed in to change notification settings - Fork1.1k
Toolsets#2024
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Merged
Toolsets#2024
Changes from1 commit
Commits
Show all changes
162 commits Select commitHold shift + click to select a range
e290951
WIP: Output modes
DouweM2056539
WIP: More output modes
DouweMbceba19
Merge remote-tracking branch 'origin/main' into output-modes
DouweM0cb25c4
Fix tests
DouweM933b74e
Remove syntax invalid before Python 3.12
DouweM7974df0
Fix tests
DouweM9cc19e2
Add TextOutput marker
DouweMbc6bb65
Merge remote-tracking branch 'origin/main' into output-modes
DouweM0e356a3
Add VCR recording of new test
DouweM81312dc
Implement additional output modes in GeminiModel and GoogleModel
DouweM52ef4d5
Fix prompted_json on OpenAIResponses
DouweMfe05956
Test output modes on Gemini and Anthropic
DouweM94421f3
Add VCR recordings of Gemini output mode tests
DouweM1902d00
Remove some old TODO comments
DouweM1f53c9b
Add missing VCR recording of Gemini output mode test
DouweMa4c2877
Add more missing VCR recordings
DouweM56e58f9
Fix OpenAI tools
DouweMa5234e1
Improve test coverage
DouweM40def08
Update unsupported output mode error message
DouweM837d305
Improve test coverage
DouweM3598bef
Merge branch 'main' into output-modes
DouweM5f71ba8
Test streaming with structured text output
DouweMcfc2749
Make TextOutputFunction Python 3.9 compatible
DouweMa137641
Properly merge JSON schemas accounting for defs
DouweMf495d46
Refactor output schemas and modes: more 'isinstance(output_schema, ..…
DouweM449ed0d
Merge branch 'main' into output-modes
DouweMe70d249
Clean up some variable names
DouweM4592b0b
Improve test coverage
DouweMdb1c628
Merge branch 'main' into output-modes
DouweMf57d078
Combine JsonSchemaOutput and PromptedJsonOutput into StructuredTextOu…
DouweM5112455
Add missing cassettes
DouweM416cc7d
Can't use dataclass kw_only on 3.9
DouweM4b0e5cf
Improve test coverage
DouweM094920f
Improve test coverage
DouweM9f61706
Improve test coverage
DouweM9f51387
Remove unnecessary coverage ignores
DouweM9a1e628
Remove unnecessary coverage ignore
DouweM2b5fa81
Add docs
DouweM6c4662b
Fix docs refs
DouweM3ed3431
Fix nested list in docs
DouweM3d77818
Merge branch 'main' into output-modes
DouweMa86d7d4
Split StructuredTextOutput into ModelStructuredOutput and PromptedStr…
DouweMce985a0
Merge branch 'main' into output-modes
DouweM71d1655
Fix WrapperModel.profile
DouweM8c04144
Update output modes docs
DouweMd78b5f7
Add examples to output mode marker docstrings
DouweM70d1197
Fix mypy type inference
DouweM2eb7fd1
Improve test coverage
DouweM25ccb54
Merge branch 'main' into output-modes
DouweM9e00c32
Import cast and RunContext in _function_schema
DouweM7de3c0d
Move RunContext and AgentDepsT into their own module to solve circula…
DouweM4029fac
Make _run_context module private, RunContext can be accessed through …
DouweM98bccf2
Merge branch 'main' into output-modes
DouweM8041cf3
Fix thinking part related tests
DouweM9bfed04
Implement Toolset
DouweM0f8da74
Make MCPServer a Toolset
DouweM8a29836
--no-edit
DouweM3d2012c
Add MappedToolset
DouweM901267d
Import Never from typing_extensions instead of typing
DouweMb9258d7
from __future__ import annotations
DouweM27ccbd1
Update client.md
DouweM3031e55
Pass only RunToolset to agent graph
DouweMebd0b57
Make WrapperToolset abstract
DouweM867bf68
Introduce ToolDefinition.kind == 'pending'
DouweMc1115ae
Rename pending tools to deferred tools
DouweM6abd603
Merge branch 'main' into toolsets
DouweMa2f69df
Fix retries
DouweM0e0bf35
Remove duplicate cassettes
DouweM735df29
Merge branch 'main' into toolsets
DouweM8745a7a
Pass just one toolset into the run
DouweM05aa972
WIP
DouweMad6e826
Fix streaming tool calls
DouweM84cd954
Stop double counting retries and reset on success
DouweM74a56ae
Fix retry error wrapping
DouweM0360e77
Make DeferredToolCalls work with streaming
DouweM6607b00
Merge branch 'main' into toolsets
DouweM8a3febb
Let toolsets be overridden in run/iter/run_stream/run_sync
DouweM2e200ac
Add DeferredToolset
DouweM1cb7f32
Add LangChainToolset
DouweMa6eba43
Add Agent.prepare_output_tools
DouweM0c96126
Require WrapperToolset subclasses to implement their own prepare_for_run
DouweM2348f45
Require DeferredToolCalls to be used with other output type
DouweM9dc684e
Merge branch 'main' into toolsets
DouweMf3124c0
Lots of cleanup
DouweMf660cc1
Some more tweaks
DouweM64dacbb
Merge branch 'main' into toolsets
DouweM5ca305e
Fix docs example
DouweMc5ef5f6
Address some feedback
DouweMbadbe23
Merge branch 'main' into toolsets
DouweMacddb8d
Add sampling_model to Agent __init__, iter, run (etc), and override, …
DouweM89fc266
Turn RunContext.retries from a defaultdict into a dict again as the 0…
DouweM7e3331b
Remove unnecessary if TYPE_CHECKING
DouweMebf6f40
Remove Agent sampling_model field (and method argument) in favor of A…
DouweMf7db040
Allow OutputSpec to be nested
DouweMfe07149
Document Agent.__aenter__
DouweMa0f4678
Import Self from typing_extensions instead of typing
DouweMdb82d00
Actually use Agent.prepare_output_tools
DouweMdea8050
Update test to account for fact that text output with early end_strat…
DouweM131a325
Improve test coverage
DouweM8203732
Merge branch 'main' into toolsets
DouweM778962c
Make Agent MCP-related tests only run when mcp can be imported
DouweMe6575a9
Add tests
DouweM9f9ee55
AbstractToolset.call_tool now takes a ToolCallPart
DouweMa3c9a59
Fix MCP process_tool_call example
DouweM6eae653
Fix test coverage
DouweM2b3a9e5
Merge branch 'main' into toolsets
DouweMb2aa894
Improve coverage
DouweMecf6f75
Merge branch 'main' into toolsets
DouweM1c2d221
Address feedback
DouweMca4915b
Make test_docs_examples an async test so Python 3.9 lets us instantia…
DouweM972e4a7
Merge branch 'main' into toolsets
DouweM93bb682
Fix test snapshots
DouweM8a986be
Revert "Make test_docs_examples an async test so Python 3.9 lets us i…
DouweM9c399c7
Make asyncio.Lock work in Python 3.9 when there is no event loop yet
DouweMa4f8c48
Address feedback, fix docs test
DouweM3e1847f
Give the A2A task some more time to complete
DouweM4daa152
Branch is OK to not be covered
DouweMc5c6f00
agent.iter(toolsets=...) is now additional, while new agent.override(…
DouweMf9ba559
Respect overridden toolsets in Agent.__aenter__ and Agent.set_mcp_sam…
DouweMb165503
Fix tool conflict error message
DouweM4baa710
Rename FunctionToolset.register_{tool,function} to add_{tool,function}
DouweM39e0353
Branch is OK to not be covered
DouweM18fcdf7
Add test to ensure tools can be added during a run
DouweMaf6ce7d
Make CallableToolset public as we're going to want to let people defi…
DouweM93e6691
Make it easier to override tool call behavior by subclassing WrapperT…
DouweM3a4c4c8
Start writing docs
DouweM87aaa6c
Make WrapperToolset easier to subclass with new _rewrap_for_run method
DouweM8b81e65
Add classes I forget to add and push
DouweMe72548e
Make all public toolsets importable from pydantic_ai.toolsets
DouweMb8c93f1
Add ACIToolset
DouweMf87319c
Document LangChainToolset and ACIToolset
DouweM8136441
Merge branch 'main' into toolsets
DouweM239fc3d
Toolset._call_tool is always async
DouweMfebbd08
A WrapperToolset subclass with no additional fields does not need to …
DouweMcfa9ccc
Add some more docs
DouweM50a72a0
Merge branch 'main' into toolsets
DouweM0151e20
Mostly finish docs
DouweMd27b4ec
Fix FunctionToolset.max_retries
DouweM692898e
Fix docs example output
DouweM06838e2
Make AbstractToolset overridable methods public
DouweM215eaae
Merge branch 'main' into toolsets
DouweM8018600
Merge remote-tracking branch 'origin/toolsets' into toolsets
DouweMb2637f8
WIP
DouweMa25df7f
WIP
DouweM13d9c03
Remove AbstractToolset.for_run_step
DouweMac5f77d
Rename AbstractToolset.accept to apply
DouweM0c8b25a
Fix toolsets docs
DouweM6046a1c
Fix example for 3.9
DouweM70d24da
Update docs
DouweMa4dedb3
Improve coverage
DouweMf48bd73
Improve docstrings
DouweMa4e0c04
Improve docstrings
DouweMfef897d
Fix docs link
DouweM9d3d240
Fix docs links
DouweMf3d1ae0
Add filtered, prefixed, prepared, renamed and wrap convenience method…
DouweMf756132
Merge branch 'main' into toolsets
DouweM57b0720
Move tool call tracing to ToolManager
DouweMe2e0f58
Merge branch 'main' into toolsets
DouweM7830c73
Fix huggingface_hub.AsyncInferenceClient link in docs
DouweMc9c8873
Add huggingface doc to nav
DouweM7e4629e
Fix coverage
DouweM28c753d
Fix coverage
DouweMFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Add LangChainToolset
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit1cb7f324b499240315b70de2de61849af4f00a28
There are no files selected for viewing
10 changes: 9 additions & 1 deletionpydantic_ai_slim/pydantic_ai/ext/langchain.py
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
6 changes: 1 addition & 5 deletionspydantic_ai_slim/pydantic_ai/toolset.py
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
45 changes: 27 additions & 18 deletionstests/ext/test_langchain.py
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
2 changes: 1 addition & 1 deletiontests/test_tools.py
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
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.