Releases: pydantic/pydantic-ai
Release list
v2.3.0 (2026-07-01)
What's Changed
π Features
- Add native Z.AI (Zhipu AI) provider with thinking support by @eliasaronson in #4273
π Bug Fixes
- fix(test): set
provider_nameonTestModelnon-streaming responses by @syf2211 in #6066 - Keep Bedrock tool results non-empty for empty lists by @Whning0513 in #6155
- fix(huggingface): don't silently drop file content in tool returns by @HaozheZhang6 in #5881
- fix: skip OpenAI thinking-only chat history messages by @adtyavrdhn in #6182
- Don't send
defer_loadingwithouttool_searchon models without native tool search by @adtyavrdhn in #6144 - Route remaining instrumentation serialization through
safe_to_jsonby @dsfaccini in #6073 - fix: reconstruct multimodal
ToolReturnPart.contentvia aToolReturnContentdiscriminator by @DouweM in #6191 - Fix
AGUIAdapter.dump_messagesreorderingToolReturnPartafterUserPromptPartby @amarjaleelbanbhan in #5969 - fix: track
new_messages()boundary by position so a rebuilt resumed request isn't leaked by @klplentific in #6034 - Preserve
tool_kindin Vercel AI and AG-UI message round-trips by @adtyavrdhn in #5873 - Make durable-exec MCP
get_toolscaching replay-deterministic by @dsfaccini in #5883 - Preserve
FilePart.content.vendor_metadatain AG-UI and Vercel AI adapter round-trips by @Navaneethp007 in #6095 - Resolve dynamic toolset
get_instructionsin an activity under Temporal by @dsfaccini in #5925
New Contributors
- @Whning0513 made their first contribution in #6155
- @eliasaronson made their first contribution in #4273
- @amarjaleelbanbhan made their first contribution in #5969
- @klplentific made their first contribution in #6034
- @Navaneethp007 made their first contribution in #6095
Full Changelog: v2.2.0...v2.3.0
v2.2.0 (2026-06-30)
What's Changed
π Features
- feat: add TwelveLabs Pegasus video-understanding example by @mohit-twelvelabs in #6061
- Add Claude Sonnet 5 (
claude-sonnet-5) support by @dsfaccini in #6161 - Allow factory functions as lifecycle arg for Dataset.evaluate by @nlsfnr in #6107
- feat: Add prompt and completions cost fields to OpenRouter by @ali-corpo in #4899
- feat: add
retry_optionsparameter toGoogleProviderby @graydeon in #4966
π Bug Fixes
- Forward image
detailfromvendor_metadataforGroqModelandMistralModelby @pydanty[bot] in #6014 - fix(utils): run sync callbacks inline on Pyodide/emscripten by default by @syf2211 in #6088
- Fix
group_by_temporalemitting first item alone when delayed past soft_max_interval by @pydanty[bot] in #5947 - Fix missing
output_audio_tokensin usage accumulation by @jnMetaCode in #4594 - fix(heroku): route model names through family profiles so thinking isn't dropped by @Bartok9 in #6070
- Guard
TogetherProvider.model_profileagainst model names without a/by @immuhammadfurqan in #6113 - fix(
GoogleModel): includeCodeExecutionToolininclude_server_side_tool_invocationscheck by @aarsh767 in #6052 - fix(groq): surface reasoning_tokens in usage details by @tcconnally in #5986
- Fix map
downstream_join_iddouble-firing the join on a non-empty iterable by @clavedeluna in #6009 - fix: de-duplicate
output_audio_tokensaccumulation in_incr_usage_tokensby @dsfaccini in #6141 - Suppress
ClosedResourceErrorwhen cancelling a graph run mid-send by @conradlee in #6149 - fix(ui): round-trip file
vendor_metadatathrough Vercel AI & AG-UI adapters by @Bartok9 in #5790 - Handle CRLF markdown JSON fences in
strip_markdown_fencesby @CodingFeng101 in #6090 - fix(heroku): avoid duplicating
/v1inbase_urlby @VectorPeak in #6142 - Fix absolute
schema_pathhandling inDataset.to_fileby @VectorPeak in #6143 - Fix
depsdeserialization in non-streaming Temporal model-request activity by @dsfaccini in #5900
New Contributors
- @Iam-Mil made their first contribution in #6132
- @jnMetaCode made their first contribution in #4594
- @mohit-twelvelabs made their first contribution in #6061
- @immuhammadfurqan made their first contribution in #6113
- @aarsh767 made their first contribution in #6052
- @tcconnally made their first contribution in #5986
- @clavedeluna made their first contribution in #6009
- @VectorPeak made their first contribution in #6140
- @nlsfnr made their first contribution in #6107
- @CodingFeng101 made their first contribution in #6090
- @ali-corpo made their first contribution in #4899
Full Changelog: v2.1.0...v2.2.0
v2.1.0 (2026-06-29)
What's Changed
π Features
- feat: Add Anthropic
_20260209web tools with server-tool replay by @adtyavrdhn in #4844 - Serialize instrumentation message attributes with to_json instead of json.dumps by @Kludex in #6045
- Add TypeAdapter for EvaluatorContext by @hon-gyu in #3373
π Bug Fixes
- Convert
ExceptionGroup-wrapped tool errors toModelRetryinMCPToolsetby @dmontagu in #6004 - fix: prevent
cancel()from flipping complete state on finished stream by @Oxygen56 in #5795 - fix(temporal): add return type annotation to
PydanticAIPlugin.__init__by @syf2211 in #6065 - fix(anthropic): support Bedrock token counting by @dyscott in #5480
New Contributors
- @lucaszhu-hue made their first contribution in #5982
- @syf2211 made their first contribution in #6065
- @dyscott made their first contribution in #5480
- @hon-gyu made their first contribution in #3373
Full Changelog: v2.0.0...v2.1.0
v2.0.0 (2026-06-23)
π Pydantic AI V2.0 is here!
After seven betas, Pydantic AI V2 is now stable. V2 leans into a harness-first design with capabilities as a core primitive β a single composable unit that bundles an agent's tools, hooks, instructions, and model settings, reaching every layer of the agent through one concept.
Install it with:
uv add pydantic-aiSee the Upgrade Guide for everything that's changed and the recommended path from V1.
What's Changed
π Features
- Add
gemini-embedding-2embedding model by @dsfaccini in #5887 - Map AG-UI interrupts to
DeferredToolsinAGUIAdapterby @jjmllr in #5441 - Add
google_tasktext-prefix conditioning forgemini-embedding-2embeddings by @dsfaccini in #5894 - feat: add
xai_max_turnstoXaiModelSettingsby @manan-tech in #5978 - Pydantic AI V2 by @DouweM in #5451
π Bug Fixes
- Don't send Gemini
function_calling_configwithout function declarations by @glendigity in #5791 - fix(openai): map image
UploadedFileparts toinput_imageby @Oxygen56 in #5809 - Fix unified
thinkinghandling for Groq qwen3 and Cerebrasgpt-ossby @dsfaccini in #5850 - Disallow non-finite
Evaluatoroutputs by @alexmojaki in #5863 - Fix
AnthropicModel.count_tokensdivergence onToolSearchToolreplay history by @dsfaccini in #5855 - Send
reasoning_contenton synthesized tool-call turns for DeepSeek thinking models by @adtyavrdhn in #5842 - Validate
UploadedFile.provider_namein tool returns and consolidate the guard intoModel._validate_uploaded_file_providerby @Oxygen56 in #5860 - Replay Cerebras
zai-glmreasoning in<think>tags and bump tozai-glm-4.7by @dsfaccini in #5891 - Retain dropped usage fields across
GoogleModelstreaming chunks by @dsfaccini in #5886 - Accumulate
output_audio_tokensinRunUsageby @HaozheZhang6 in #5904 - fix(output): validate union
kinddiscriminator in text output by @ret2libc in #5845 - fix(openai): prevent AG-UI stalls during multi-server MCP discovery by @cooleryu in #5443
- Forward
additionalModelRequestFieldsin Bedrockcount_tokensby @dsfaccini in #5910 - Fix
MCPToolset(http_client=...)crash on FastMCP'sfollow_redirectskwarg by @he-yufeng in #5694 - fix(cohere): forward
tool_choicefromModelSettingsto v2 chat API by @Julien-ser in #5833 - Route
max_tokenstomax_completion_tokensormax_tokensviaOpenAIModelProfileflag by @dsfaccini in #5926 - Forward
top_kmodel setting to BedrockadditionalModelRequestFieldsby @dsfaccini in #5922 - Fix
FallbackModeldeclaring an unassigned_model_namedataclass field by @dorukgezici in #5932 - fix(groq): add
groq_reasoning_effortsetting by @Oxygen56 in #5797 - fix: use running loop in chat app example by @Ghraven in #5971
- fix(cohere): forward usage.cached_tokens as cache_read_tokens by @bdpgmbv in #5957
- fix(mistral): forward penalties in completions by @he-yufeng in #5695
- Emit
reasoning_effort='none'for Cerebras, deprecatecerebras_disable_reasoning, addcerebras_clear_thinkingby @dsfaccini in #5897
New Contributors
- @glendigity made their first contribution in #5791
- @Oxygen56 made their first contribution in #5809
- @HaozheZhang6 made their first contribution in #5904
- @ret2libc made their first contribution in #5845
- @cooleryu made their first contribution in #5443
- @jjmllr made their first contribution in #5441
- @strickvl made their first contribution in #5908
- @Julien-ser made their first contribution in #5833
- @MylittleQueercat made their first contribution in #5876
- @Kropiunig made their first contribution in #5928
- @Nukually made their first contribution in #5813
- @MakenRosa made their first contribution in #5997
- @manan-tech made their first contribution in #5978
- @MeloMei made their first contribution in #5950
- @kaxil made their first contribution in #5984
- @pranavmutatkar made their first contribution in #5991
- @Ghraven made their first contribution in #5971
- @bdpgmbv made their first contribution in #5957
Full Changelog: v2.0.0b7...v2.0.0
v2.0.0b7 (2026-06-10)
π Pydantic AI V2 Beta 7 is here!
For more information on Pydantic AI V2, see the release notes for v2.0.0b1 and the Upgrade Guide.
Beta 7 adds no new breaking or v2-specific changes, but pulls in these changes from v1.107.0:
What's Changed
π‘οΈ Security
- Handle
UploadedFileconsistently withFileUrlin UI adapters by @dsfaccini in #5772- Security advisory:
VercelAIAdaptertrusts client-controlled provider metadata to constructUploadedFilereferences (confused-deputy file read) GHSA-h7p7-w5gc-xj3w - This fix went out in v1.106.0 and v2.0.0b6.
- You are affected only if your application passes untrusted client-submitted message history to an agent through a UI adapter (e.g.
VercelAIAdapter), AND your model-provider or cloud-storage account holds files referenceable by an attacker-guessableUploadedFileid or storage URI (e.g.s3://β¦,gs://β¦). - You are not affected if you do not pass untrusted client-submitted message history to the agent, or you strip
UploadedFileparts before running it. - You are not affected via
AGUIAdapter/Agent.to_ag_uion defaults β thepreserve_file_dataflag that re-enables this path is off by default.
- Security advisory:
π Features
- Add
known_model_names()to enumerateKnownModelNamemembers by @dsfaccini in #5803 - feat(openrouter): add
CachePointand prompt caching support by @Adversarian in #4604 - Add Claude Fable 5 (
claude-fable-5) and Claude Mythos 5 (claude-mythos-5) support by @dsfaccini in #5849
π Bug Fixes
- fix(anthropic): guard
message=NoneBedrock start events in stream path by @Bartok9 in #5818 - Fix
AnthropicModel.count_tokenswith native tools by @kazmer97 in #5704
π¦ Dependencies
- chore(deps): bump the python-packages group across 1 directory with 18 updates by @dependabot[bot] in #5768
New Contributors
Full Changelog: v2.0.0b6...v2.0.0b7
v1.107.0 (2026-06-10)
What's Changed
π‘οΈ Security
- Handle
UploadedFileconsistently withFileUrlin UI adapters by @dsfaccini in #5772- Security advisory:
VercelAIAdaptertrusts client-controlled provider metadata to constructUploadedFilereferences (confused-deputy file read) GHSA-h7p7-w5gc-xj3w - This fix went out in v1.106.0 and v2.0.0b6.
- You are affected only if your application passes untrusted client-submitted message history to an agent through a UI adapter (e.g.
VercelAIAdapter), AND your model-provider or cloud-storage account holds files referenceable by an attacker-guessableUploadedFileid or storage URI (e.g.s3://β¦,gs://β¦). - You are not affected if you do not pass untrusted client-submitted message history to the agent, or you strip
UploadedFileparts before running it. - You are not affected via
AGUIAdapter/Agent.to_ag_uion defaults β thepreserve_file_dataflag that re-enables this path is off by default.
- Security advisory:
π Features
- Add
known_model_names()to enumerateKnownModelNamemembers by @dsfaccini in #5803 - feat(openrouter): add
CachePointand prompt caching support by @Adversarian in #4604 - Add Claude Fable 5 (
claude-fable-5) and Claude Mythos 5 (claude-mythos-5) support by @dsfaccini in #5849
π Bug Fixes
- fix(anthropic): guard
message=NoneBedrock start events in stream path by @Bartok9 in #5818 - Fix
AnthropicModel.count_tokenswith native tools by @kazmer97 in #5704
π¦ Dependencies
- chore(deps): bump the python-packages group across 1 directory with 18 updates by @dependabot[bot] in #5768
New Contributors
Full Changelog: v1.106.0...v1.107.0
v2.0.0b6 (2026-06-04)
π Pydantic AI V2 Beta 6 is here!
For more information on Pydantic AI V2, see the release notes for v2.0.0b1 and the Upgrade Guide.
Beta 6 adds no new breaking or v2-specific changes, but pulls in these changes from v1.106.0:
What's Changed
π‘οΈ Security
- Handle
UploadedFileconsistently withFileUrlin UI adapters by @dsfaccini in #5772- Security advisory:
VercelAIAdaptertrusts client-controlled provider metadata to constructUploadedFilereferences (confused-deputy file read) GHSA-h7p7-w5gc-xj3w - You are affected only if your application passes untrusted client-submitted message history to an agent through a UI adapter (e.g.
VercelAIAdapter), AND your model-provider or cloud-storage account holds files referenceable by an attacker-guessableUploadedFileid or storage URI (e.g.s3://β¦,gs://β¦). - You are not affected if you do not pass untrusted client-submitted message history to the agent, or you strip
UploadedFileparts before running it. - You are not affected via
AGUIAdapter/Agent.to_ag_uion defaults β thepreserve_file_dataflag that re-enables this path is off by default.
- Security advisory:
π Features
- Map base
seedsetting to xAI by @colesmcintosh in #5741 - Add
api_hostandtimeouttoXaiProviderby @colesmcintosh in #5742
π Bug Fixes
- Fix incomplete streamed response when
event_stream_handlerdoesn't consume the stream by @adtyavrdhn in #5771 - fix(messages): from_data_uri crashes on a valid non-base64 data URI by @devteamaegis in #5779
New Contributors
- @lonelyhty made their first contribution in #5759
- @devteamaegis made their first contribution in #5779
Full Changelog: v2.0.0b5...v2.0.0b6
v1.106.0 (2026-06-04)
What's Changed
π‘οΈ Security
- Handle
UploadedFileconsistently withFileUrlin UI adapters by @dsfaccini in #5772- Security advisory:
VercelAIAdaptertrusts client-controlled provider metadata to constructUploadedFilereferences (confused-deputy file read) GHSA-h7p7-w5gc-xj3w - You are affected only if your application passes untrusted client-submitted message history to an agent through a UI adapter (e.g.
VercelAIAdapter), AND your model-provider or cloud-storage account holds files referenceable by an attacker-guessableUploadedFileid or storage URI (e.g.s3://β¦,gs://β¦). - You are not affected if you do not pass untrusted client-submitted message history to the agent, or you strip
UploadedFileparts before running it. - You are not affected via
AGUIAdapter/Agent.to_ag_uion defaults β thepreserve_file_dataflag that re-enables this path is off by default.
- Security advisory:
π Features
- Map base
seedsetting to xAI by @colesmcintosh in #5741 - Add
api_hostandtimeouttoXaiProviderby @colesmcintosh in #5742
π Bug Fixes
- Fix incomplete streamed response when
event_stream_handlerdoesn't consume the stream by @adtyavrdhn in #5771 - fix(messages): from_data_uri crashes on a valid non-base64 data URI by @devteamaegis in #5779
New Contributors
- @lonelyhty made their first contribution in #5759
- @devteamaegis made their first contribution in #5779
Full Changelog: v1.105.0...v1.106.0
v2.0.0b5 (2026-06-02)
π Pydantic AI V2 Beta 5 is here!
For more information on Pydantic AI V2, see the release notes for v2.0.0b1 and the Upgrade Guide.
Beta 5 adds no new breaking or v2-specific changes, but pulls in these changes from v1.105.0:
What's Changed
π Features
- feat: On-demand (deferred loading) capabilities, including instructions, tools, model settings, and hooks by @adtyavrdhn in #5230
- Add Grok 4.3
reasoning_effortsupport and current xAI model names by @adtyavrdhn in #5454
π Bug Fixes
- Fix
gateway/model construction inside a Temporal workflow by passing provider SDKs through the sandbox by @adtyavrdhn in #5733 - Fix
GoogleModelSettings.google_cached_contentso request omitssystem_instruction,tools, andtool_configby @gaurav0107 in #5681
New Contributors
- @gaurav0107 made their first contribution in #5681
Full Changelog: v2.0.0b4...v2.0.0b5
v1.105.0 (2026-06-02)
What's Changed
π Features
- feat: On-demand (deferred loading) capabilities, including instructions, tools, model settings, and hooks by @adtyavrdhn in #5230
- Add Grok 4.3
reasoning_effortsupport and current xAI model names by @adtyavrdhn in #5454
π Bug Fixes
- Fix
gateway/model construction inside a Temporal workflow by passing provider SDKs through the sandbox by @adtyavrdhn in #5733 - Fix
GoogleModelSettings.google_cached_contentso request omitssystem_instruction,tools, andtool_configby @gaurav0107 in #5681
New Contributors
- @gaurav0107 made their first contribution in #5681
Full Changelog: v1.104.0...v1.105.0