Releases: pydantic/pydantic-ai
Releases Β· pydantic/pydantic-ai
v1.22.0 (2025-11-21)
What's Changed
- Add OpenRouterModel as OpenAIChatModel subclass with additional feature support by @ajac-zero in #3089
- Make
FallbackModelfall back on all model API errors, not just HTTP status 400+ by @dsfaccini in #3494 - Don't skip model request when history ends on response but there are new instructions by @DouweM in #3509
- Revert "feat: enforce message history starts with user message" by @DouweM in #3508
- Don't send Google messages with 0 parts by @DouweM in #3511
- Immediately raise error when response is empty because of token limit by @DouweM in #3512
- Relax UserError into a warning when state deps is not provided with AG-UI by @MikeRyanDev in #3510
- Add type stubs for some third-party libraries by @lars20070 in #3443
- Add document to allowed
cacheable_typesfor anthropic by @marpulli in #3513 - Don't insert empty
ThinkingPartwhenGoogleresponse ends in text withthought_signatureby @DouweM in #3516 - Fix deprecated
GeminiModelstructured output and tool call thought signatures by @DouweM in #3517
New Contributors
Full Changelog: v1.21.0...v1.22.0
v1.21.0 (2025-11-20)
What's Changed
- Feature: MCP client Resources support by @fennb in #3024
- Expose MCP server instructions in
MCPServer.instructionsproperty by @mochow13 in #3431 - Add
BinaryContent.from_pathconvenience method by @dsfaccini in #3482 - Enforce message history starts with user message by @Pavanmanikanta98 in #3440
- Always strip Markdown fences from structured output by @DouweM in #3475
- Fix Gemini nested tool argument schemas by removing
titlefrom$defsby @conradlee in #3487 - Fix issue with Gemini and Prefect by removing unused
GoogleModel._urlby @DouweM in #3499
New Contributors
- @Pavanmanikanta98 made their first contribution in #3440
- @fennb made their first contribution in #3024
Full Changelog: v1.20.0...v1.21.0
v1.20.0 (2025-11-18)
What's Changed
- Add support for Gemini 3 Pro by @DouweM in #3464
- Support Gemini enhanced JSON Schema features by @conradlee in #3357
- Wrap
GoogleModelgoogle.genai.errors.APIErrorinModelHTTPErrorso it works withFallbackModelby @timothy-jeong in #3139 - fix: Change handling of empty state objects for AG-UI by @MikeRyanDev in #3462
- Adds
{ModelRequest,ModelResponse}.metadatafields by @adtyavrdhn in #3422 - Make
RunContext.usageavailable with Temporal by @mattbrandman in #3434 - Add
ttltoCachePointand Anthropic caching model settings by @Wh1isper in #3450 - Extract google model usage using genai-prices by @alexmojaki in #3466
- Update has_content method to check content data by @dsfaccini in #3436
New Contributors
- @conradlee made their first contribution in #3357
- @MikeRyanDev made their first contribution in #3462
- @timothy-jeong made their first contribution in #3139
Full Changelog: v1.19.0...v1.20.0
v1.19.0 (2025-11-17)
What's Changed
- Let
metadatabe passed toCallDeferredandApprovalRequiredexceptions and end up onDeferredToolRequestsby @cjohnhanson in #3345 - Add AnthropicModel
count_tokensand supportUsageLimits.count_tokens_before_requestby @nathan-gage in #3458 - Fix bug with running graphs in temporal workflows by @dmontagu in #3460
- Fix Gateway with Temporal by adding sniffio to sandbox passthrough modules by @DouweM in #3455
- Fix Gateway links in code blocks by @NicolasPllr1 in #3444
New Contributors
- @NicolasPllr1 made their first contribution in #3444
Full Changelog: v1.18.0...v1.19.0
v1.18.0 (2025-11-14)
What's Changed
- Add Anthropic prompt caching support by @ronakrm in #3363
- Bump
openaito v2.8.0 (v1 still supported), add GPT-5.1 to known model names by @DouweM in #3419 - Bump
google-genaito v1.50.1 and remove patches by @DouweM in #3340 - Bump
temporalioto v1.19.0 and useSimplePluginby @DouweM in #3214
New Contributors
- @notrudyyy made their first contribution in #3421
- @ronakrm made their first contribution in #3363
Full Changelog: v1.17.0...v1.18.0
v1.17.0 (2025-11-13)
What's Changed
- Add Pydantic AI Gateway docs by @laisbsc in #3402
- Make
FastMCPToolsetwork withTemporalby @DouweM in #3413 - Support
mcp.jsonenvironment variable expansion inload_mcp_servers()by @wgillett in #3380
New Contributors
Full Changelog: v1.16.0...v1.17.0
v1.16.0 (2025-11-13)
What's Changed
Full Changelog: v1.15.0...v1.16.0
v1.15.0 (2025-11-12)
What's Changed
- Wrap
BedrockConverseModelerrors inModelHTTPErrorto work well withFallbackModelby @cjermain in #3377 - Add unique
run_idto run, run result, and message (request, response) classes by @adtyavrdhn in #3366 - Add
BedrockConverseModel.count_tokensso it works withUsageLimits.count_tokens_before_requestby @DenysMoskalenko in #3367
Full Changelog: v1.14.1...v1.15.0
v1.14.1 (2025-11-11)
What's Changed
- Fix Vercel AI tool input/output always showing up as a JSON string rather than object by @DouweM in #3399
- Make
ModelRetryhashable by @nathan-gage in #3394 - Don't run CI steps that require secrets on PRs from fork branch to fork
mainby @lars20070 in #3385
New Contributors
- @lars20070 made their first contribution in #3385
- @nathan-gage made their first contribution in #3394
Full Changelog: v1.14.0...v1.15.0
v1.14.0 (2025-11-10)
What's Changed
- Allow custom provider factory to be passed into
infer_modelby @slkoo-cc in #3341 - Fix error when Google returns only empty text parts by @naveen-corpusant in #3388
- Docs: AWS Bedrock retry behavior by @cjermain in #3379
- docs: fix link to AG-UI Dojo by @echarles in #3387
New Contributors
Full Changelog: v1.13.0...v1.13.1