Releases: pydantic/pydantic-ai
Releases · pydantic/pydantic-ai
v1.0.3 (2025-09-10)
What's Changed
- Include thinking parts in subsequent model requests to improve performance and cache hit rates by @DouweM in #2823
- Add
on_completecallback to AG-UI functions to get access toAgentRunResultby @ChuckJonas in #2429 - Support
ModelSettings.seedinGoogleModelby @DouweM in #2842 - Add
with agent.sequential_tool_calls():contextmanager and use it inDBOSAgentby @DouweM in #2856 - Ensure
ModelResponsefields are set from actual model response when streaming by @DouweM in #2848 - Send AG-UI thinking start and end events by @DouweM in #2855
- Support models that return output tool args as
{"response': "<JSON string>"}by @shaheerzaman in #2836 - Support
NativeOutputwithFunctionModelby @DouweM in #2843 - Raise error when
WebSearchToolis used withOpenAIChatModeland unsupported model by @safina57 in #2824
New Contributors
- @safina57 made their first contribution in #2824
- @shaheerzaman made their first contribution in #2836
Full Changelog: v1.0.2...v1.0.3
v1.0.2 (2025-09-08)
What's Changed
- Add support for durable execution with DBOS by @qianl15 in #2638
- Support sequential tool calling by @strawgate in #2718
- Add
GoogleModelSettings.google_cached_contentto passcached_contentby @Hojland in #2832 - Add
ModelResponse.finish_reasonand setprovider_response_idwhile streaming by @fatelei in #2590 - Add support for
gen_ai.response.idby @Kludex in #2831 - Only send tool choice to Bedrock Converse API for Anthropic and Nova models by @DouweM in #2819
- Handle errors in cost calculation in InstrumentedModel by @alexmojaki in #2834
New Contributors
- @Hojland made their first contribution in #2832
- @qianl15 made their first contribution in #2638
- @fatelei made their first contribution in #2590
Full Changelog: v1.0.1...v1.0.2
v1.0.1 (2025-09-05)
Breaking Changes
The following breaking change was slated to go into v1.0.0 but accidentally left out. Because it's a security issue, an uncommonly used feature, and few people will have updated to v1 yet within 24 hours, we decided it was justified to make an exception to the no-breaking-changes policy to get it out ASAP.
Other Changes
Full Changelog: v1.0.0...v1.0.1
v1.0.0 (2025-09-04)
What's Changed
- Drop support for Python 3.9 by @Kludex in #2725
- Deprecate
OpenAIModelProfile.openai_supports_sampling_settingsby @Kludex in #2730 - Add support for human-in-the-loop tool call approval by @DouweM in #2581
- Add
tool_calls_limittoUsageLimitsandtool_callstoRunUsageby @tradeqvest in #2633 - Add LiteLLM provider for OpenAI API compatible models by @mochow13 in #2606
- Add
identifierfield toFileUrland subclasses by @kyuam32 in #2636 - Support
NativeOutputwith Groq by @DouweM in #2772 - Add
docstring_format,require_parameter_descriptions,schema_generatortoFunctionToolsetby @g-eoj in #2601 - Gracefully handle errors in evals by @dmontagu in #2295
- Include
logfirewith pydantic-ai package by @Kludex in #2683 - Let almost all types used in docs examples be imported directly from
pydantic_aiby @DouweM in #2736 - Bump
temporalioto 1.17.0 by @DouweM in #2811 - Default
InstrumentationSettingsversionto 2 by @alexmojaki in #2726 - Remove cases and averages from eval span by @DouweM in #2715
- Make many more dataclasses kw-only by @dmontagu in #2738
- Don't emit empty AG-UI thinking message events by @DouweM in #2754
- Update
mcppackage version by @BrokenDuck in #2741 - Raise error if MCP server
__aexit__is called when_running_countis already0by @federicociner in #2696 - Fix error when streaming from Gemini includes only
executable_codeorcode_execution_resultby @binaryCrossEntropy in #2719 - Close original response when retrying HTTP request by @DouweM in #2753
Agent.__aenter__returnsSelf, use default instrumentation for MCP sampling model by @alexmojaki in #2765- Fix Anthropic streaming usage counting by @DouweM in #2771
- Create separate
ThinkingPartsfor separate OpenAI Responses reasoning summary parts by @DouweM in #2775 - Handle Groq
tool_use_failederrors by getting model to retry by @DouweM in #2774 - Raise error when trying to use Google built-in tools with user/output tools by @DouweM in #2777
- Move
mcp-run-pythonto its own repo by @samuelcolvin in #2776 - Fix Azure OpenAI streaming when async content filter is enabled by @frednijsvrt in #2763
- Don't emit AG-UI text message content events with empty text part deltas by @celeritatem in #2779
- Handle streaming thinking signature deltas from Bedrock Converse API by @DouweM in #2785
- Don't require
MCPServerStreamableHTTPandMCPServerSSEurlto be a keyword argument by @franciscovilchezv in #2758 - Add
operation.costspan attribute to model request spans, renameModelResponse.price()to.cost()by @alexmojaki in #2767 - Ensure that old
ModelResponses stored in a DB can still be deserialized by @DouweM in #2792 - Type
ModelRequest.partsandModelResponse.partsasSequenceby @moritzwilksch in #2798 - Always run
event_stream_handlerinside Temporal activity by @DouweM in #2806 - Document that various functions need to be async to be used with Temporal by @DouweM in #2809
New Contributors
- @BrokenDuck made their first contribution in #2741
- @federicociner made their first contribution in #2696
- @g-eoj made their first contribution in #2601
- @binaryCrossEntropy made their first contribution in #2719
- @Trollgeir made their first contribution in #2729
- @kyuam32 made their first contribution in #2636
- @richhuth made their first contribution in #2680
- @frednijsvrt made their first contribution in #2763
- @celeritatem made their first contribution in #2779
- @mochow13 made their first contribution in #2606
- @franciscovilchezv made their first contribution in #2758
- @moritzwilksch made their first contribution in #2798
Full Changelog: v0.8.1...v1.0.0
v1.0.0b1 (2025-08-30)
What's Changed
- Drop support for Python 3.9 by @Kludex in #2725
- Add support for human-in-the-loop tool call approval by @DouweM in #2581
- Deprecate
OpenAIModelProfile.openai_supports_sampling_settingsby @Kludex in #2730 - Gracefully handle errors in evals by @dmontagu in #2295
- Include logfire with pydantic-ai package by @Kludex in #2683
- Remove errors when passing Retrying instead of RetryConfig to TenacityTransport by @DouweM in #2717
- Default
InstrumentationSettingsversionto 2 by @alexmojaki in #2726 - Remove cases and averages from eval span by @DouweM in #2715
- Make many more dataclasses kw-only by @dmontagu in #2738
Full Changelog: v0.8.1...v1.0.0b1
v0.8.1 (2025-08-29)
What's Changed
- Add
gen_ai.system_instructionsattribute to agent run spans by @alexmojaki in #2699 - Bump
temporalioto 1.16.0 by @DouweM in #2703 - Rename
StreamedRunResultmethods to be consistent withAgentStreamby @DouweM in #2692 - Deprecate specifying a model name without a provider prefix, and the
vertexaiprovider name by @DouweM in #2711 - Rename
ModelResponse.provider_request_idtoprovider_response_idby @DouweM in #2710 - docs: Add
message_historyparameter documentation for CLI methods by @ryx2 in #2695
Full Changelog: v0.8.0...v0.8.1
v0.8.0 (2025-08-26)
What's Changed
- Add elicitation callback support to MCP servers by @yamanahlawat in #2373
- Add
message_historyparameter toagent.to_cli()by @ryx2 in #2674 - Properly deserialize complex tool arguments with Temporal by @DouweM in #2686
- Fix serialization / deserialization of
FileUrl.media_typeby @mwildehahn in #2677 - Handle missing token details in vLLM/OpenAI-compatible APIs by @DouweM in #2669
- Make AgentStreamEvent union of ModelResponseStreamEvent and HandleResponseEvent by @DouweM in #2689
Full Changelog: v0.7.6...v0.8.0
v0.7.6 (2025-08-26)
What's Changed
- Replace
all_messages_eventswithpydantic_ai.all_messagesforInstrumentationSettings(version=2)by @alexmojaki in #2658 - Fix inability to call response.raise_for_status in AsyncTenacityTransport by @dmontagu in #2668
- Deprecate
OpenAIModelin favor ofOpenAIChatModelby @Kludex in #2676 - anthropic: drop new lines on empty system prompt by @Kludex in #2678
- fix(bedrock): skip SystemPromptPart with empty content by @essamgouda97 in #2672
- BREAKING CHANGE: Fix tenacity implementation for improved retry behavior by @dmontagu in #2670
- Add Cerebras provider by @Kludex in #2643
New Contributors
- @essamgouda97 made their first contribution in #2672
Full Changelog: v0.7.5...v0.7.6
v0.7.5 (2025-08-25)
What's Changed
- Handle 'STOP' finish_reason in GeminiStreamedResponse by @ArneZsng in #2631
- Add
price()method toModelResponseby @Kludex in #2584 - Include thoughts tokens in output_tokens for Google models by @alexmojaki in #2634
- Add
span_idandtrace_idtoEvaluationReportby @Kludex in #2627 - Allow proper type on
AnthropicProviderwhen using Bedrock by @akoshel in #2490 - Use new OpenTelemetry GenAI chat span attribute conventions by @alexmojaki in #2349
- Ensure
contentis always set for assistant tool call messages for OpenAI. by @vimota in #2641
New Contributors
- @ArneZsng made their first contribution in #2631
- @akoshel made their first contribution in #2490
- @vimota made their first contribution in #2641
Full Changelog: v0.7.4...v0.7.5
v0.7.4 (2025-08-20)
What's Changed
- Fix bug with google model safety handling by @dmontagu in #2066
- Add
takes_ctxarg toTool.from_schemaby @dedeswim in #2615 - feat: support Google's url_context builtin tool by @vinnymeller in #2604
- Add missing UrlContextTool into all by @Kludex in #2617
- Drop assertion on Google streaming by @Kludex in #2618
New Contributors
- @dedeswim made their first contribution in #2615
- @vinnymeller made their first contribution in #2604
- @ivo-1 made their first contribution in #2610
Full Changelog: v0.7.3...v0.7.4