Release history
pydantic-ai releases
AI Agent Framework, the Pydantic way
All releases
73 shown
- Added `tool_choice` configuration setting
- Introduced `OutputToolCallEvent` and `OutputToolResultEvent` for handling output tool calls; deprecated corresponding function-tool events
Full changelog
What's Changed
🚀 Features
- Add
tool_choicesetting by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/3611 - Yield
OutputToolCallEvent/OutputToolResultEventfor output tool calls; deprecate function-tool events for failing output tool calls by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5320
🐛 Bug Fixes
- Drain spawned tasks during agent cancellation by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5341
New Contributors
- @DhruvGarg111 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4958
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.92.0...v1.93.0
- Added Anthropic task budget support
- Added runtime `output_retries` override and deprecated `retries`
Full changelog
What's Changed
🚀 Features
- Add Anthropic task budget support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5140
- Add runtime
output_retriesoverride + deprecateretries+ internal retry-field rename by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5075
🐛 Bug Fixes
- Fix: Clean up streaming responses on cancellation by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5313
- Fix
attempted exit cancel scope in different taskby running MCP session in a dedicated task by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/4514 - Populate
for_runRunContextwithrun_id,conversation_id, andmetadataby @DouweM in https://github.com/pydantic/pydantic-ai/pull/5330 - fix(evals): guarantee
CaseLifecycle.teardown()by @voorhs in https://github.com/pydantic/pydantic-ai/pull/5322
New Contributors
- @voorhs made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5322
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.91.0...v1.92.0
- Support for `gpt-image-2` options in OpenAI integration
- Added support for `deepseek-v4-flash` and `deepseek-v4-pro` models
Full changelog
What's Changed
🚀 Features
- feat(openai): support
gpt-image-2options by @banteg in https://github.com/pydantic/pydantic-ai/pull/5234 - feat(deepseek): add support for
deepseek-v4-flashanddeepseek-v4-proby @SuperMarioYL in https://github.com/pydantic/pydantic-ai/pull/5195
🐛 Bug Fixes
- fix(evals): preserve Unicode in YAML datasets by @Kcstring in https://github.com/pydantic/pydantic-ai/pull/5245
- Skip empty
ModelResponsein OpenAI Chat assistant message mapping by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5300 - Fix MCP history replay for empty tool arguments by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5314
New Contributors
- @Kcstring made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5245
- @khaldon made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5301
- @SuperMarioYL made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5195
- @banteg made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5234
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.90.0...v1.91.0
- Upgraded web UI dependency to `pydantic/ai-chat-ui` version 1.2.0.
- Added `OpenAIResponsesModelSettings.openai_conversation_id` for OpenAI Conversations API state support.
- Typed OTel metadata added for code tool call syntax highlighting.
Full changelog
What's Changed
🚀 Features
- feat: add OpenAI Conversations API state support via
OpenAIResponsesModelSettings.openai_conversation_idby @corytomlinson in https://github.com/pydantic/pydantic-ai/pull/5224 - feat: typed OTel metadata for code tool call syntax highlighting by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5297
📦 Dependencies
- Upgrade web UI to
pydantic/ai-chat-ui1.2.0 by @johnthagen in https://github.com/pydantic/pydantic-ai/pull/5246
New Contributors
- @johnthagen made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5246
- @Acacian made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4888
- @VeniVeci made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5283
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.89.1...v1.90.0
- Added bundled Library Skills for improved coding‑agent support
Full changelog
What's Changed
🤖 Coding Agent Experience
- Add bundled Library Skills(https://library-skills.io) for improved coding-agent support by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5271
🐛 Bug Fixes
- fix: restore
wrap_validation_errorsonToolManagerfunction-tool methods by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5275 - Defer
anyio.Lockcreation viacached_propertyto bind to running loop by @Kludex in https://github.com/pydantic/pydantic-ai/pull/5265
New Contributors
- @dependabot[bot] made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5268
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.89.0...v1.89.1
- Added `conversation_id` for cross-run correlation
- Supported dynamic capabilities via callables in the capabilities list
- Added `builtin_tools` to `agent.override`
Full changelog
What's Changed
🚀 Features
- feat: add
conversation_idfor cross-run correlation by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5251 - feat(capabilities): support dynamic capabilities via callables in capabilities list by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5252
- feat: add
builtin_toolstoagent.overrideby @mplemay in https://github.com/pydantic/pydantic-ai/pull/5248
🐛 Bug Fixes
- fix(evals): use non-daemon thread for background evaluators by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/5247
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.88.0...v1.89.0
- prepare_tools scoped to function tools only; output validate/process hooks and prepare_output_tools introduced
- Cross-provider service_tier model setting supporting Anthropic, Gemini API, Vertex Priority PayGo
- Fast mode for Anthropic Claude Opus 4.6
- OpenAI Responses phase support on assistant messages
Full changelog
What's Changed
🚀 Features
- feat(capabilities)!: output validate/process hooks; scope
prepare_toolsto function tools, addprepare_output_toolsby @DouweM in https://github.com/pydantic/pydantic-ai/pull/4859 - feat: cross-provider
service_tiermodel setting; Anthropic + Gemini API + Vertex Priority PayGo support by @markmcd in https://github.com/pydantic/pydantic-ai/pull/4926 - Add anthropic speed,
fastmode for opus 4.6 by @bohdanhr in https://github.com/pydantic/pydantic-ai/pull/4300 - feat: support OpenAI Responses
phaseon assistant messages by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5229 - feat(ui): add
UIAdapter.sanitize_messagesandallowed_file_url_schemesby @DouweM in https://github.com/pydantic/pydantic-ai/pull/5228
🐛 Bug Fixes
- fix: restore per-block
cache_controlforanthropic_cache_messagesby @Wh1isper in https://github.com/pydantic/pydantic-ai/pull/5227 - fix: propagate original error when
CallToolsNodestream fails by @thejens in https://github.com/pydantic/pydantic-ai/pull/4799 - fix: propagate
Agent(retries=...)to user-provided toolsets by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/4745
New Contributors
- @markmcd made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4926
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.87.0...v1.88.0
- HandleDeferredToolCalls capability
- ProcessEventStream capability
- GPT-5.5 thinking setting
Full changelog
What's Changed
🚀 Features
- Add
HandleDeferredToolCallscapability andhandle_deferred_tool_callshook by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5142 - Add
ProcessEventStreamcapability by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5141 - Handle thinking setting for GPT-5.5 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5196
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.86.1...v1.87.0
Minor fixes and improvements.
Full changelog
What's Changed
🐛 Bug Fixes
- fix(openai): guard against
choices=Nonein streamed chunks (#5165) by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5170 - fix(anthropic): send
container_idas string on reuse; unwrap broken {id: x} shape by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5168 - fix: preserve validation error
inputon tool-call retries by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5181 - fix(toolsets): prevent
MCPServer.__aexit__called more times than__aenter__inDynamicToolsetby @anishesg in https://github.com/pydantic/pydantic-ai/pull/5171 - Warn about
dictfields with Anthropic strict mode by @rahulmansharamani14 in https://github.com/pydantic/pydantic-ai/pull/4321 - Set
gen_ai.operation.name=execute_toolon tool-execution spans by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5182 - fix: avoid stale client references in model and embedding classes by @Deeven-Seru in https://github.com/pydantic/pydantic-ai/pull/4276
New Contributors
- @anishesg made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5171
- @rahulmansharamani14 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4321
- @Deeven-Seru made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4276
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.86.0...v1.86.1
- UIAdapter.manage_system_prompt with ReinjectSystemPrompt capability
Full changelog
What's Changed
🚀 Features
- feat(ui): add
UIAdapter.manage_system_prompt+ReinjectSystemPromptcapability by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/4087
🐛 Bug Fixes
- fix(vercel-ai): allow regenerate requests without
messageIdby @MukundaKatta in https://github.com/pydantic/pydantic-ai/pull/5156 - Handle dict
reasoning_contentfrom Gemini 2.5 models by @JulieLiu99 in https://github.com/pydantic/pydantic-ai/pull/5155
New Contributors
- @MukundaKatta made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5156
- @JulieLiu99 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5155
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.85.1...v1.86.0
Minor fixes and improvements.
Full changelog
What's Changed
🐛 Bug Fixes
- fix: exclude validation error
inputfrom retry messages by @navalprakhar in https://github.com/pydantic/pydantic-ai/pull/4947 - fix(vercel-ai): auto-detect deferred tool approval state in
dump_messages()by @tijmenhammer in https://github.com/pydantic/pydantic-ai/pull/4831
New Contributors
- @abhicris made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5149
- @navalprakhar made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4947
- @tijmenhammer made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4831
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.85.0...v1.85.1
## What's Changed ### 🚀 Features * Online evaluation via OpenTelemetry events
Full changelog
What's Changed
🚀 Features
- Online evaluation via OpenTelemetry events by @dmontagu in https://github.com/pydantic/pydantic-ai/pull/5125
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.84.1...v1.85.0
Fixed tool hook behavior for internal output tools and BaseModel arguments.
Full changelog
What's Changed
🐛 Bug Fixes
- Skip tool hooks for internal output tools by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5128
- Always pass
dict-shaped validated args to hooks for single-BaseModeltools by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5137
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.84.0...v1.84.1
- Fix exponential-time regex in Google FileSearchTool response parsing
- Claude Opus 4.7 support
- Stateful compaction mode for OpenAICompaction
- OllamaModel subclass with corrected capability flags
Full changelog
What's Changed
:lock: Security
- Fix exponential-time regex in Google
FileSearchToolresponse parsing by @DouweM in #5106. This was first released in yesterday's v1.83.0. The pattern was reachable in principle from Gemini streaming responses but could not be triggered via real Gemini output in testing, so we're treating it as a hardening fix rather than a vulnerability.
🚀 Features
- Add Claude Opus 4.7 support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5118
- Add stateful compaction mode to
OpenAICompactionby @DouweM in https://github.com/pydantic/pydantic-ai/pull/5108 - Add
OllamaModelsubclass and correct Ollama capability flags to fix structured output on Ollama Cloud by @Goldokpa in https://github.com/pydantic/pydantic-ai/pull/4160
🐛 Bug Fixes
- Fix deferred tool search keyword matching by @pandego in https://github.com/pydantic/pydantic-ai/pull/5014
- Fixing parsing
openai_logprobsfor streamed responses by @iAmir97 in https://github.com/pydantic/pydantic-ai/pull/5091 - fix(openai): handle null text in Responses API output by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5124
- Chain OpenAI Responses retries through concrete
openai_previous_response_idseeds by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5126 - fix: exclude resumed requests from
new_messages()even with currentrun_idby @madanlalit in https://github.com/pydantic/pydantic-ai/pull/4731
New Contributors
- @iAmir97 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5091
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.83.0...v1.84.0
- XSearchTool and FileSearch support for xAI
- Anthropic automatic prompt caching support
- Metadata injection per tool call with FastMCPToolset
Full changelog
🤖 Pydantic AI Harness is now live with Code Mode powered by Monty!
What's Changed
🚀 Features
- feat: Add
XSearchToolandFileSearchsupport for xAI by @colesmcintosh in https://github.com/pydantic/pydantic-ai/pull/4165 - Allow injecting metadata per tool call with
FastMCPToolsetby @Boryotto in https://github.com/pydantic/pydantic-ai/pull/4929 - feat(bedrock): add prompt cache TTL support by @imdigitalashish in https://github.com/pydantic/pydantic-ai/pull/4581
- Add Anthropic automatic prompt caching support by @DenysMoskalenko in https://github.com/pydantic/pydantic-ai/pull/4840
- Add 'graceful' end strategy for parallel tool calls by @awkoy in https://github.com/pydantic/pydantic-ai/pull/4333
- Support Agent(output_type=str | None) for optional output by @Pavanmanikanta98 in https://github.com/pydantic/pydantic-ai/pull/4042
New Contributors
- @colesmcintosh made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4165
- @Boryotto made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4929
- @imdigitalashish made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4581
- @awkoy made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4333
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.82.0...v1.83.0
- Pydantic AI Harness with Code Mode powered by Monty
Full changelog
🤖 Pydantic AI Harness is now live with Code Mode powered by Monty!
What's Changed
🐛 Bug Fixes
- Fix OpenAI compaction chain when
openai_previous_response_id='auto'by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5086 - Fix orphan-task leak in
CombinedToolsetandCombinedCapabilityby @DouweM in https://github.com/pydantic/pydantic-ai/pull/5085 - Lazily compute
ToolDefinition.function_signatureby @DouweM in https://github.com/pydantic/pydantic-ai/pull/5087
📦 Dependencies
- chore: bump fastmcp 2.x → 3.2.0 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/4982
New Contributors
- @gvdongen made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5041
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.81.0...v1.82.0
- Pydantic AI Harness with Code Mode powered by Monty
Full changelog
🤖 Pydantic AI Harness is now live with Code Mode powered by Monty!
What's Changed
🐛 Bug Fixes
- Fix Anthropic compaction usage totals by @pandego in https://github.com/pydantic/pydantic-ai/pull/5068
- Exclude
run_idfrom cache key computation inPrefectAgentInputsby @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/3890 - fix: handle boolean JSON Schema nodes in
JsonSchemaTransformerby @Dharit13 in https://github.com/pydantic/pydantic-ai/pull/4989 - fix: close pending tool calls on stream error by @proever in https://github.com/pydantic/pydantic-ai/pull/4963
- fix: skip api-version query parameter for Azure AI Foundry serverless endpoints by @Ricardo-M-L in https://github.com/pydantic/pydantic-ai/pull/5071
New Contributors
- @Dharit13 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/4989
- @pandego made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5068
Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v1.80.0...v1.81.0
- CapabilityOrdering with innermost, outermost, wraps, wrapped_by, requires
- Server-side compaction via OpenAICompaction and AnthropicCompaction
- Hooks ordering parameter with instance refs
- HTTP client cache replaced with create_async_http_client context manager
- Full AG-UI 0.1.13 and 0.1.15 support with reasoning and dump_messages
- AbstractCapability.apply() method
- Cached token span attributes per OTel specification
- ToolDefinition.return_schema and function_signature fields
- SetToolMetadata capability
- Local WebFetch tool with automatic provider fallback
- defer_loading parameter for tool search
- ThreadExecutor capability
- Mistral integration updated to SDK v2
- ImageGeneration auto-fallback to subagent
- agent field in RunContext
- gemini-embedding-2-preview types and limits
- VertexAI Flex PayGo support
- Dataset without name parameter deprecated
- Online evaluation infrastructure
- TextContent for metadata-only user prompts
- Time-sortable run IDs with span attributes
- CaseLifecycle hooks for Dataset.evaluate
- ModelRetry exception in hooks
- Model swapping via ModelRequestContext
- anthropic_eager_input_streaming to AnthropicModelSettings
- Sync tool preparation functions
- MCP URL parameter made optional
- Capabilities composable behavior units
- AgentSpec YAML/JSON loading with templated instructions
- Hooks capability with decorators
- Agent description parameter with span attribute
- Direct multimodal tool results to APIs
- Response-based fallback for FallbackModel
- GPT-5.4 support
- WebSearchTool for OpenRouterModel via plugins
- Tavily search tool overhaul
- Qwen 3.5 native structured output support
- gemini-3.1-flash-image-preview model
- UploadedFile object for provider files
- gemini-3.1-flash-lite-preview model
- template=False on PromptedOutput and NativeOutput
- Gemini 3.1 Pro Preview support
- Logprob support for Gemini
- args_validator parameter for tools
- Tool approval integration for Vercel AI
- LinePlot analysis type
- ROCAUCEvaluator and KolmogorovSmirnovEvaluator
- video_url support to OpenRouterModel
- instrumentation version 4 for OTel multimodal
- Model.model_id property
- opt-in flag for aggregated usage attribute names
- enhance Contains evaluator for pydantic.BaseModel
- report-level evaluators
- multi-run aggregation support
- extra_headers for Google provider
Fixed A2A FilePart base64 decoding for image and file uploads
- disallow downloading FileUrls pointing at local network by default
- Claude Opus 4.6 with anthropic_effort and adaptive thinking
- anthropic_betas setting
Fixed OpenAI compatible provider reasoning_tokens None handling and MultiModalContent union discriminator for deserialization
- concurrency limiting for Agents and Models
- gateway base URL inferred from token region
- openai_store setting for data retention
- output validation retries in run context
- Vercel AI SDK v5 compatibility
- usage_limits and model_settings exposure for to_cli()
- OpenAI raw text annotations in TextPart
- Parallel tool calls in DBOSAgent
- BedrockEmbeddingModel for Nova, Cohere, Titan
- allowed_domains for WebSearchTool
- continuous_usage_stats model setting
Ensured thought signatures and provider metadata survive round-trip through Vercel AI frontend.
- GrokProvider deprecated in favor of XaiModel
- XaiModel using xAI SDK
- OpenRouter now sends DocumentUrls instead of downloading bytes
- VoyageAI embeddings support
- Exa search tools integration
- Bedrock Nova 2.0 Code Interpreter support
- SambaNova provider support
- OTel GenAI semantic convention attributes
- YAML and TOML media type support
- metadata for DeferredToolResults
- Temporal activity summaries
- Tool call retry for nonexistent calls
Fixed partial_output flag behavior in streaming output, prevented duplicated tool calls when using cache results, updated thoughtSignature for Vertex Gemini 3 compatibility, and corrected input_tokens calculation for Bedrock models.