Heads up This site is currently under heavy development.
← all tools
◆ AI Agent Frameworks

PydanticAI

v2.36.0 open-source

How Python does AI: agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end.

Summary

PydanticAI is an open-source AI tool that provides a typed, extensible agent loop connecting to various models via a string swap. It requires no explicit cost to use. Users incorporate it as a library into their existing Python code to manage agent workflows. This is intended for application developers building agent systems. Its documentation positions it alongside other frameworks for building LLM-powered applications. As of the latest commit status, the project maintains active development activity.

How Python does AI: agents, realtime voice, image generation, embeddings. Every model, every interface, typed end to end.

What PydanticAI answers

Which environments can the agent loop execute within?

in a web frontend, the terminal, a voice call, a durable background queue, or as a simple callable object

What modalities can the agent interact with?

text, voice, and images

What types of external services does it support?

various models through a string swap mechanism

What kind of functionality is included out of the box?

embeddings and image generation capabilities

What is the mechanism for connecting different models?

a string swap approach

Does the agent library have a command-line interface?

yes, it includes one for terminal use

Release history

  1. v2.36.0 Aug 29, 2026 · issue 011

    PydanticAI v2.36.0 adds @durable_operation for third-party durable execution, stable InstructionPart.id, async-iterable audio input, and --mcp-config support in clai.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.36.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.36.0
    └──▷ USE IT
    Stream audio from an async generator directly into a realtime voice session instead of pushing discrete chunks.
    python
    async def mic_chunks():
        async for chunk in microphone_stream():
            yield chunk
    
    async with agent.realtime('openai:gpt-realtime-2.1').session() as session:
        await session.send_audio(mic_chunks())
    • Adds --mcp-config flag to the clai CLI, enabling MCP server configuration from the command line; also adds tool-call streaming support to clai.
    • Introduces @durable_operation decorator with a required explicit operation name, plus a public backend API for integrating third-party durable execution engines.
    • Gives InstructionPart a stable InstructionPart.id field, making instruction parts addressable and stable across runs.
    • Accepts async iterables in RealtimeSession.send_audio(), enabling streaming microphone input from async generators rather than only discrete chunks.
  2. v2.34.0 Aug 25, 2026 · issue 007

    PydanticAI v2.34.0 adds GLM-5.3 support via ZhipuModel and a LangChain migration skill.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.34.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.34.0
    • Adds a LangChain migration skill to help teams port existing LangChain agents to PydanticAI.
  3. v2.32.0 Aug 19, 2026 · issue 002

    PydanticAI v2.32.0 adds xAI attachment search lifecycle, OpenRouter web-search annotations, and instrumentation v6 with tool-role emissions.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.32.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.32.0
    • Surfaces OpenRouter web-search sources in provider_details["annotations"] on message objects, making citation data accessible to downstream code.
    • Adds instrumentation version 6, emitting tool results under role: 'tool' for improved observability of tool call/result pairs in traces.
    • Supports xAI attachment search lifecycle, enabling attachment-based search flows via the xAI provider.
  4. v2.31.0 Aug 15, 2026 · issue -004

    PydanticAI v2.31.0 lets UIEventStream initialize without a run_input and gives AGUIEventStream its own thread_id/run_id.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.31.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.31.0
    • Adds support for building a UIEventStream without a run_input, enabling stream construction before run context is available.
    • Gives AGUIEventStream its own thread_id and run_id fields for independent stream identification.
  5. v2.31.0 Aug 15, 2026 · issue 002

    UIEventStream can now be built without a run_input, and AGUIEventStream gets its own thread_id and run_id.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.31.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.31.0
    • Allows UIEventStream to be constructed without a run_input, enabling more flexible event stream initialization.
    • Gives AGUIEventStream its own thread_id and run_id fields for independent stream identity.
  6. v1.107.5 Aug 14, 2026 · issue 002

    Adds allowed_hosts setting to the local dev web UI to prevent DNS rebinding attacks on Agent.to_web() / clai web.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.107.5 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.107.5
    • Adds allowed_hosts setting to the local dev web chat UI (Agent.to_web() / clai web) to explicitly permit non-localhost hostnames, required for deployments reached under a real hostname.
    └──▷ BREAKING ON UPGRADE
    • !The local dev web chat UI (Agent.to_web(), clai web) now validates the Host header against localhost/loopback/LAN addresses by default; deployments served under a real (non-local) hostname will be blocked and must opt in with the new allowed_hosts setting.
  7. v2.30.0 Aug 14, 2026 · issue -005

    PydanticAI v2.30.0 adds allowed_hosts for the local web UI, OpenRouter web search, Gemini 3.7 Flash, and gRPC metadata on XaiProvider.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.30.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.30.0
    └──▷ USE IT
    Allow the local web UI to be reached under a custom hostname in a non-loopback deployment.
    python
    agent.to_web(allowed_hosts=['mydevbox.internal'])
    Run a web search via OpenRouter directly from a PydanticAI agent.
    python
    from pydantic_ai import Agent
    agent = Agent(model='openrouter:web_search')
    result = agent.run_sync('What are the latest CVEs in OpenSSL?')
    print(result.data)
    • Adds allowed_hosts setting to Agent.to_web() and clai web to explicitly permit non-loopback hostnames when deploying the local dev web chat UI under a real hostname.
    • Adds support for openrouter:web_search as a web search model via the OpenRouter provider.
    • Adds gemini-3.7-flash to the supported Gemini model catalog.
    • Exposes gRPC metadata on XaiProvider for passing custom gRPC metadata to xAI endpoints.
    └──▷ BREAKING ON UPGRADE
    • !The local dev web chat UI (Agent.to_web(), clai web) now validates the Host header against localhost/loopback/LAN addresses by default; deployments reached under a real hostname will be blocked unless allowed_hosts is explicitly configured.
  8. v2.30.0 Aug 14, 2026 · issue 002

    PydanticAI v2.30.0 adds allowed_hosts for the web UI, OpenRouter web search, Gemini Flash 3.7, and xAI gRPC metadata support.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.30.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.30.0
    └──▷ USE IT
    Allow a specific external hostname when hosting the web UI beyond localhost — required after the new Host-header validation is enforced by default.
    python
    agent.to_web(allowed_hosts=['myagent.internal.example.com'])
    Run a one-shot web-search-backed query through OpenRouter directly from the CLI.
    $ clai --model openrouter:web_search 'What are the latest CVEs in OpenSSL?'
    • Adds allowed_hosts setting to Agent.to_web() and clai web to explicitly permit non-localhost hostnames, required for deployments served under a real hostname (introduced alongside a Host-header validation fix for GHSA-q2xc-rrxj-58x9).
    • Supports openrouter:web_search as a model string for built-in web search via OpenRouter.
    • Adds gemini-3.7-flash to the supported model catalog.
    • Exposes gRPC metadata on XaiProvider for passing custom gRPC metadata to xAI endpoints.
    └──▷ BREAKING ON UPGRADE
    • !The local dev web chat UI (Agent.to_web(), clai web) now validates the Host header against localhost/loopback/LAN addresses by default; deployments served under a real hostname will be blocked unless they opt in with the new allowed_hosts setting.
  9. v2.29.0 Aug 13, 2026 · issue -006

    PydanticAI v2.29.0 adds FastMCP 4 / MCP SDK v2 support and Azure AI Voice Live integration.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.29.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.29.0
    • Adds azure_voice_live setting to enable Azure AI Voice Live realtime voice capabilities.
    • Supports FastMCP 4 and MCP SDK v2 in MCPToolset alongside the existing FastMCP 3 compatibility.
  10. v2.29.0 Aug 13, 2026 · issue 002

    PydanticAI v2.29.0 adds FastMCP 4 / MCP SDK v2 support in MCPToolset and Azure AI Voice Live via azure_voice_live.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.29.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.29.0
    • Adds azure_voice_live setting to enable Azure AI Voice Live as a realtime voice backend.
    • Supports FastMCP 4 and MCP SDK v2 in MCPToolset alongside the existing FastMCP 3 compatibility.
  11. v2.28.0 Aug 12, 2026 · issue -007

    PydanticAI v2.28.0 adds real-time speech-to-speech via Agent.realtime() plus a new Crusoe provider

    └──▷ GET THIS VERSION
    $ git clone --branch v2.28.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.28.0
    • Adds Agent.realtime() method for real-time speech-to-speech interactions with an agent.
    • Adds browser WebRTC and server sideband support for real-time speech-to-speech sessions.
    • Adds Crusoe as a new LLM provider.
    • Adds cerebras optional dependency group.
  12. v2.28.0 Aug 12, 2026 · issue 002

    PydanticAI v2.28.0 adds real-time speech-to-speech via Agent.realtime(), WebRTC sideband support, and a Crusoe model provider.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.28.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.28.0
    └──▷ USE IT
    Put an agent on a live voice session with tools — the model calls your tools mid-conversation while it keeps talking.
    python
    import asyncio
    from pydantic_ai import Agent
    
    agent = Agent(instructions='You are a helpful voice assistant.')
    
    @agent.tool_plain
    def order_status(order_id: str) -> str:
        """Look up the status of an order."""
        return f'Order {order_id}: shipped, arriving Thursday.'
    
    async with agent.realtime('openai:gpt-realtime-2.1').session() as session:
        async for part in session.stream_transcripts():
            print(f'{part.speaker}: {part.transcript}')
    • Adds Agent.realtime() method for real-time speech-to-speech sessions, enabling live voice conversations with tool-calling support across OpenAI Realtime, Gemini Live, Azure, and xAI Grok Voice backends.
    • Adds browser WebRTC plus server sideband support for real-time speech-to-speech sessions initiated via Agent.realtime().
    • Adds a cerebras optional dependency group for the Cerebras provider.
    • Adds Crusoe as a new model provider.
  13. v2.27.0 Aug 8, 2026 · issue -011

    PydanticAI v2.27.0 adds SnowflakeModel/SnowflakeProvider, xai_agent_count setting, and CompactionPart round-trip for Vercel AI and AG-UI adapters.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.27.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.27.0
    • Adds xai_agent_count field to XaiModelSettings for controlling xAI agent concurrency.
    • Adds SnowflakeModel and SnowflakeProvider classes for integrating with Snowflake Cortex as an LLM backend.
    • Supports round-tripping CompactionPart through the Vercel AI and AG-UI adapters, preserving compaction state across adapter boundaries.
  14. v2.27.0 Aug 8, 2026 · issue 002

    PydanticAI v2.27.0 adds Snowflake Cortex support, xAI agent count control, and CompactionPart round-tripping across Vercel AI and AG-UI adapters.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.27.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.27.0
    • Adds xai_agent_count field to XaiModelSettings to control the number of xAI agents used per request.
    • Adds SnowflakeModel and SnowflakeProvider classes for Snowflake Cortex LLM integration.
    • Supports round-tripping CompactionPart through the Vercel AI and AG-UI adapters, preserving compaction state across adapter boundaries.
  15. v2.26.0 Aug 7, 2026 · issue -012

    PydanticAI v2.26.0 adds run cancellation, hidden/revealed tools, DeepSeek V4 Flash support, and a public AgentRunEvents handle.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.26.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.26.0
    └──▷ USE IT
    Stream agent events and cancel mid-run based on application logic using the new public AgentRunEvents handle.
    python
    async with agent.run_stream_events(user_prompt) as events:
        async for event in events:
            if should_stop(event):
                events.cancel()
                break
    Use DeepSeek V4 Flash in an agent via the OpenAI-compatible responses model and DeepSeek provider.
    python
    from pydantic_ai.models.openai import OpenAIResponsesModel
    from pydantic_ai.providers.deepseek import DeepSeekProvider
    
    model = OpenAIResponsesModel('deepseek-chat', provider=DeepSeekProvider())
    agent = Agent(model=model)
    • Adds AgentRun.cancel() and RunContext.cancel() for first-party run cancellation, raising RunCancelled to stop in-flight agent runs programmatically.
    • Adds Model.resolve_prompt_cache_retention() to resolve the effective prompt-cache retention setting from model settings.
    • Promotes the run_stream_events() iterator to a public AgentRunEvents handle exposing cancel() and run-state access.
    • Supports hiding function tools until revealed — via tool search, load_capability, or ToolReturn.tools — using each provider's native deferral/addition channel.
    • Covers DeepSeek V4 Flash via OpenAIResponsesModel and DeepSeekProvider.
  16. v2.26.0 Aug 7, 2026 · issue 002

    PydanticAI v2.26.0 adds first-party run cancellation, hidden/revealed tools, DeepSeek V4 Flash support, and a public AgentRunEvents handle.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.26.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.26.0
    └──▷ USE IT
    Cancel a long-running agent run from outside the agent loop — useful for enforcing timeouts or user-triggered stops.
    python
    import asyncio
    from pydantic_ai import Agent
    
    agent = Agent('openai:gpt-4o')
    
    async def main():
        async with agent.run_stream('Summarize the entire history of computing') as run:
            asyncio.get_event_loop().call_later(5, run.cancel)
            async for chunk in run.stream_text():
                print(chunk, end='', flush=True)
    
    asyncio.run(main())
    Cancel a run from inside a tool when a condition is met — e.g. an abuse-detection tool that aborts the run immediately.
    python
    from pydantic_ai import Agent, RunContext
    
    agent = Agent('openai:gpt-4o')
    
    @agent.tool
    def safety_check(ctx: RunContext[None], text: str) -> str:
        if 'forbidden' in text:
            ctx.cancel()
            return 'Aborted.'
        return 'OK'
    
    result = agent.run_sync('Please say something forbidden')
    print(result.output)
    • Adds AgentRun.cancel() and RunContext.cancel() methods plus a RunCancelled exception for first-party run cancellation.
    • Adds Model.resolve_prompt_cache_retention() to resolve the effective prompt-cache retention from model settings.
    • Promotes run_stream_events() to a public AgentRunEvents handle with cancel() and run-state access.
    • Supports hiding function tools until revealed via tool search, load_capability, or ToolReturn.tools, using each provider's native deferral/addition channel.
    • Adds DeepSeek V4 Flash support via OpenAIResponsesModel and DeepSeekProvider.
  17. v2.25.0 Aug 6, 2026 · issue -013

    PydanticAI v2.25.0 forwards xAI FileSearchTool collection search options.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.25.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.25.0
    • Forwards xAI FileSearchTool collections search options to the underlying API.
  18. v2.25.0 Aug 6, 2026 · issue 002

    PydanticAI v2.25.0 forwards xAI FileSearchTool collection search options to the xAI backend.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.25.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.25.0
    • Forwards xAI FileSearchTool collections search options through to the xAI backend, enabling parameterized file-search collection queries.
  19. v2.23.0 Aug 4, 2026 · issue -015

    PydanticAI v2.23.0 adds cost tracking with cost and cost_limit, Bedrock extra_headers, and dynamic tool availability parts.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.23.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.23.0
    └──▷ USE IT
    Cap how much an agent run can spend by setting a cost_limit on UsageLimits alongside an existing token budget.
    python
    from pydantic_ai import Agent
    from pydantic_ai.usage import UsageLimits
    
    agent = Agent('openai:gpt-4o')
    result = await agent.run(
        'Summarize this document...',
        usage_limits=UsageLimits(request_limit=10, cost_limit=0.05),
    )
    print(result.usage().cost)
    Pass custom headers (e.g. for cost allocation tagging) to every Bedrock request via ModelSettings.extra_headers.
    python
    from pydantic_ai import Agent
    from pydantic_ai.settings import ModelSettings
    
    agent = Agent('bedrock:anthropic.claude-3-5-sonnet-20241022-v2:0')
    result = await agent.run(
        'Explain zero-trust networking.',
        model_settings=ModelSettings(extra_headers={'x-amzn-bedrock-workload-name': 'sec-review'}),
    )
    print(result.output)
    • Adds cost field to RunUsage and cost_limit field to UsageLimits to track and cap monetary spend per agent run.
    • Adds extra_headers support in ModelSettings for Amazon Bedrock requests.
    • Adds ToolAvailabilityDeltaPart with native tool_addition and additional_tools rendering to represent dynamic tool availability changes in agent message streams.
  20. v2.23.0 Aug 4, 2026 · issue 002

    PydanticAI v2.23.0 adds cost tracking to RunUsage, a cost_limit to UsageLimits, ToolAvailabilityDeltaPart, and Bedrock extra_headers support.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.23.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.23.0
    └──▷ USE IT
    Fail an agent run before it spends beyond a set dollar threshold — useful for enforcing per-request budget limits in production.
    python
    from pydantic_ai import Agent
    from pydantic_ai.usage import UsageLimits
    
    agent = Agent('openai:gpt-5.6-sol')
    result = agent.run_sync(
        'Summarize the latest earnings report.',
        usage_limits=UsageLimits(cost_limit=0.05),
    )
    print(result.usage().cost)
    • Adds cost field to RunUsage and cost_limit to UsageLimits to track and cap monetary spend per agent run.
    • Adds extra_headers support to ModelSettings for Amazon Bedrock requests, matching parity with other providers.
    • Adds ToolAvailabilityDeltaPart with native tool_addition and additional_tools rendering for streaming tool-availability deltas.
  21. v2.22.0 Aug 1, 2026 · issue -018

    PydanticAI v2.22.0 adds RunContext.is_tool_available, MCP task-skipping via prefer_tasks, and Gemini VALIDATED tool mode by default.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.22.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.22.0
    └──▷ USE IT
    Skip optional MCP background tasks (e.g. sampling) when the host runtime does not support them, avoiding hangs on unsupported transports.
    python
    from pydantic_ai.mcp import MCPToolset
    
    toolset = MCPToolset(
        server_url='http://localhost:3000',
        prefer_tasks=False  # skip optional MCP tasks rather than blocking
    )
    • Adds RunContext.is_tool_available method, letting tool code check at runtime whether another named tool is accessible in the current agent context.
    • Adds prefer_tasks parameter to MCPToolset clients, allowing optional MCP tasks to be skipped when the runtime does not support them.
    • Adds configurable max_retries to ToolSearchToolset, giving control over how many times a tool-search lookup is retried on failure.
    • Enables Gemini VALIDATED tool mode by default on supported models, improving structured tool-call reliability without manual configuration.
    • Sends mid-conversation system prompts as native system messages on Anthropic, aligning prompt delivery with Anthropic's native message format.
  22. v2.22.0 Aug 1, 2026 · issue 002

    PydanticAI v2.22.0 adds RunContext.is_tool_available, MCPToolset task-skipping via prefer_tasks, and Gemini VALIDATED tool mode by default.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.22.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.22.0
    └──▷ USE IT
    Gate one tool's behavior on whether a complementary tool is currently registered and available in the run.
    python
    from pydantic_ai import Agent, RunContext
    
    agent = Agent('openai:gpt-4o')
    
    @agent.tool
    async def summarize(ctx: RunContext[None], text: str) -> str:
        if ctx.is_tool_available('fetch_document'):
            return f'(fetch available) Summary of: {text}'
        return f'Summary of: {text}'
    • Adds RunContext.is_tool_available method, letting tool code check at runtime whether another tool is currently available before attempting to call it.
    • Adds prefer_tasks parameter to MCPToolset clients, allowing optional MCP tasks to be skipped when not needed.
    • Adds configurable max_retries to ToolSearchToolset for controlling retry behavior on tool search failures.
    • Enables Gemini VALIDATED tool mode by default on supported models, improving structured tool-call reliability.
    • Sends mid-conversation system prompts as native system messages on Anthropic models instead of user-turn injections.
  23. v2.21.0 Jul 30, 2026 · issue -020

    PydanticAI v2.21.0 adds per_request_input_tokens_limit to UsageLimits for per-call token budgets.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.21.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.21.0
    └──▷ USE IT
    Prevent any single LLM call from consuming more than a set number of input tokens, useful for guarding against unexpectedly large context windows in multi-turn agents.
    python
    from pydantic_ai import Agent
    from pydantic_ai.usage import UsageLimits
    
    agent = Agent('openai:gpt-4o')
    result = agent.run_sync(
        'Summarize this document.',
        usage_limits=UsageLimits(per_request_input_tokens_limit=4000),
    )
    • Adds per_request_input_tokens_limit field to UsageLimits to cap input tokens on a per-request basis, independently of aggregate limits.
  24. v2.21.0 Jul 30, 2026 · issue 002

    PydanticAI v2.21.0 adds per_request_input_tokens_limit to UsageLimits for per-request token budgeting.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.21.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.21.0
    └──▷ USE IT
    Prevent any single LLM request from consuming more than a set number of input tokens, useful for cost-controlling agents that may construct large context windows.
    python
    from pydantic_ai import Agent
    from pydantic_ai.usage import UsageLimits
    
    agent = Agent('openai:gpt-5.6-sol')
    result = agent.run_sync(
        'Summarize this document.',
        usage_limits=UsageLimits(per_request_input_tokens_limit=4000),
    )
    • Adds per_request_input_tokens_limit field to UsageLimits to cap input tokens on a per-request basis, independently of cumulative session limits.
  25. v2.20.0 Jul 29, 2026 · issue -021

    PydanticAI v2.20.0 adds Claude Opus 5 and OpenAI Responses API reasoning.context support for GPT-5 families.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.20.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.20.0
    └──▷ USE IT
    Run inference against the new Claude Opus 5 model.
    python
    from pydantic_ai import Agent
    
    agent = Agent('anthropic:claude-opus-5')
    result = agent.run_sync('Summarize the OWASP Top 10 for 2025.')
    print(result.output)
    • Adds reasoning.context support for the OpenAI Responses API, defaulting to all_turns, for the gpt-5.4, gpt-5.5, and gpt-5.6 model families.
    • Adds claude-opus-5 model support via the Anthropic provider.
  26. v2.20.0 Jul 29, 2026 · issue 002

    PydanticAI v2.20.0 adds Claude Opus 5 support and OpenAI Responses API reasoning.context for the gpt-5.4/5.5/5.6 families.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.20.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.20.0
    └──▷ USE IT
    Use Claude Opus 5 as the model for a PydanticAI agent.
    python
    from pydantic_ai import Agent
    
    agent = Agent('anthropic:claude-opus-5')
    result = agent.run_sync('Summarize the latest threat intelligence report.')
    print(result.output)
    • Adds reasoning.context support (default all_turns) in the OpenAI Responses API for the gpt-5.4, gpt-5.5, and gpt-5.6 model families.
    • Adds support for claude-opus-5 via the anthropic:claude-opus-5 model string.
  27. v2.19.0 Jul 28, 2026 · issue -022

    PydanticAI v2.19.0 adds headers and retry_after fields to ModelHTTPError for richer HTTP error inspection.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.19.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.19.0
    └──▷ USE IT
    Respect a provider's rate-limit retry window by reading retry_after from a caught ModelHTTPError.
    python
    import asyncio
    from pydantic_ai.exceptions import ModelHTTPError
    
    try:
        result = await agent.run('summarize this')
    except ModelHTTPError as e:
        wait = e.retry_after  # seconds until the provider allows retry
        if wait:
            await asyncio.sleep(wait)
        # inspect raw response headers if needed
        print(e.headers)
    • Adds headers and retry_after attributes to ModelHTTPError, populated from all provider SDKs, enabling programmatic inspection of rate-limit and retry signals from HTTP errors.
  28. v2.19.0 Jul 28, 2026 · issue 002

    PydanticAI v2.19.0 adds headers and retry_after fields to ModelHTTPError across all provider SDKs.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.19.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.19.0
    • Adds headers and retry_after attributes to ModelHTTPError, populated from all provider SDKs, giving callers direct access to HTTP response headers and rate-limit retry timing from a single exception type.
  29. v2.18.0 Jul 25, 2026 · issue -025

    PydanticAI v2.18.0 adds AdvisorTool for Anthropic/OpenRouter, BedrockMantleProvider, multi-region Google Cloud, and external web access for OpenAI WebSearchTool.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.18.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.18.0
    └──▷ USE IT
    Route Bedrock requests through the Mantle provider for managed AWS Bedrock access.
    python
    from pydantic_ai.providers.bedrock_mantle import BedrockMantleProvider
    
    provider = BedrockMantleProvider()
    • Adds external_web_access option to WebSearchTool for OpenAI Responses API, enabling built-in web search without a separate tool.
    • Adds BedrockMantleProvider for AWS Bedrock Mantle integration, with normalized response-scoped tool-call IDs.
    • Extends AdvisorTool support to Anthropic and OpenRouter providers.
    • Adds 'us' and 'eu' multi-region location values to GoogleCloudProvider location type.
  30. v2.18.0 Jul 25, 2026 · issue 002

    PydanticAI v2.18.0 adds AdvisorTool for Anthropic/OpenRouter, BedrockMantleProvider, multi-region Google Cloud, and external_web_access for WebSearchTool.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.18.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.18.0
    • Adds external_web_access option to WebSearchTool for OpenAI Responses API, enabling web search grounding on OpenAI Responses-backed agents.
    • Adds BedrockMantleProvider for AWS Bedrock Mantle, with normalized response-scoped tool-call IDs.
    • Extends AdvisorTool support to Anthropic and OpenRouter providers.
    • Adds 'us' and 'eu' multi-region location values to GoogleCloudProvider location type.
  31. v2.17.0 Jul 24, 2026 · issue -026

    PydanticAI v2.17.0 adds arbitrary fields to usage types and caches OTel serialization to eliminate O(n²) instrumentation cost.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.17.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.17.0
    • Adds support for arbitrary fields on RequestUsage and RunUsage to accommodate extended provider-specific pricing and metadata.
    • Caches per-message OpenTelemetry serialization, eliminating O(n²) instrumentation overhead for long conversation traces.
  32. v2.17.0 Jul 24, 2026 · issue 002

    RequestUsage and RunUsage now accept arbitrary fields; OTel serialization cached to eliminate O(n²) instrumentation cost.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.17.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.17.0
    • Extends RequestUsage and RunUsage to accept arbitrary extra fields, enabling support for upcoming genai-prices metadata.
    • Caches per-message OpenTelemetry serialization to eliminate O(n²) instrumentation overhead on long runs.
  33. v2.16.0 Jul 23, 2026 · issue -027

    PydanticAI v2.16.0 adds ToolFailed, Model Armor, run_id support, Mistral caching, and OpenAI moderation surface.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.16.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.16.0
    └──▷ USE IT
    Raise a model-visible tool error without consuming retry budget — useful when a tool call is definitively invalid rather than transiently failing.
    python
    from pydantic_ai import ToolFailed
    
    @agent.tool
    async def lookup_user(ctx, user_id: str) -> str:
        if not user_id.startswith('u_'):
            raise ToolFailed('user_id must start with u_; got: ' + user_id)
        return fetch_user(user_id)
    Enable prompt caching and parallel tool calls for a Mistral-backed agent to reduce latency and cost on repeated prompts.
    python
    result = await agent.run(
        'Summarize the threat landscape',
        model_settings={
            'mistral_prompt_cache_key': 'threat-landscape-v1',
            'parallel_tool_calls': True,
        },
    )
    Attach a stable run_id to an agent run so downstream traces, logs, and UI adapters can correlate the same logical execution.
    python
    result = await agent.run(
        'Analyze this incident report',
        run_id='incident-2025-07-14-001',
    )
    • Adds mistral_prompt_cache_key setting and passes parallel_tool_calls to the Mistral SDK via model settings.
    • Adds openai_moderation to OpenAIChatModelSettings and exposes Chat Completions moderation results in provider_details.
    • Adds Google Model Armor support for Google Cloud via GoogleModelSettings.
    • Adds optional run_id= parameter to agent runs, durable wrappers, and UI adapters for correlating runs.
    • Adds ToolFailed exception class for surfacing model-visible tool failures without triggering retries.
    +1 moreshow less
    • Adds gemini-3.6-flash and gemini-3.5-flash-lite as supported model identifiers.
  34. v2.16.0 Jul 23, 2026 · issue 002

    PydanticAI v2.16.0 adds ToolFailed, run_id, Model Armor, Mistral cache keys, OpenAI moderation, and two new Gemini models.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.16.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.16.0
    └──▷ USE IT
    Signal a non-retriable tool failure to the model without consuming retry budget.
    python
    from pydantic_ai import Agent
    from pydantic_ai.exceptions import ToolFailed
    
    agent = Agent('openai:gpt-4o')
    
    @agent.tool_plain
    def fetch_record(record_id: str) -> str:
        if record_id == 'missing':
            raise ToolFailed('Record not found; try a different ID.')
        return f'Record {record_id}: active'
    Attach a stable run_id to an agent run for correlation across logs and durable workflows.
    python
    result = await agent.run('Summarise this document', run_id='run-2025-07-abc123')
    • Adds mistral_prompt_cache_key setting to MistralModelSettings and passes parallel_tool_calls through to the Mistral SDK.
    • Hoists openai_moderation into OpenAIChatModelSettings and exposes Chat Completions moderation results in provider_details.
    • Adds Model Armor support for Google Cloud via GoogleModelSettings.
    • Adds optional run_id= parameter to agent runs, durable wrappers, and UI adapters for stable run identification.
    • Adds ToolFailed exception class for signalling model-visible tool failures without triggering retries.
    +1 moreshow less
    • Adds gemini-3.6-flash and gemini-3.5-flash-lite as supported model identifiers.
  35. v2.15.0 Jul 22, 2026 · issue -028

    PydanticAI v2.15.0 adds per-run tool-retry budget overrides, OpenAI moderation, and DynamicCapability toolset support in durable execution.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.15.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.15.0
    └──▷ TRY IT
    Cap tool retries for a single high-stakes run without changing the agent's default retry budget.
    $ result = await agent.run('Fetch and summarize the report', tool_retry_budget=2)
    Enable OpenAI Responses API moderation and inspect the result on the model response.
    python
    result = await agent.run('Draft a message', model_settings={'openai_moderation': True})
    print(result.all_messages()[-1].provider_details)
    • Adds openai_moderation setting to expose OpenAI Responses API moderation results in provider_details.
    • Supports overriding the tool-retry budget at run, iter, and override time, giving per-invocation control over retry limits.
    • Supports DynamicCapability toolsets in durable execution, wrapping DynamicToolset in DBOS steps and Prefect tasks.
    • Adds explicit prompt caching support for gpt-5.6 in OpenAIModel.
    • Inlines text-like files in MistralModel prompts for cleaner multimodal input handling.
    +1 moreshow less
    • Introduces ExaSearch capability in Pydantic AI Harness as the successor to the Exa search common tools.
  36. v2.15.0 Jul 22, 2026 · issue 002

    PydanticAI v2.15.0 adds per-run tool-retry budget overrides, OpenAI moderation settings, and DynamicCapability support in durable execution.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.15.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.15.0
    • Adds openai_moderation setting to expose OpenAI Responses API moderation results in provider_details.
    • Supports overriding the tool-retry budget at run, iter, and override time.
    • Supports DynamicCapability toolsets in durable execution and wraps DynamicToolset in DBOS steps and Prefect tasks.
    • Adds register_legacy_workflows to DBOSDurability for clean DBOSAgent migration.
    • Supports explicit prompt caching for gpt-5.6 in openai provider.
    +2 moreshow less
    • Inlines text-like files in MistralModel prompts.
    • Adds ExaSearch capability in Pydantic AI Harness as the replacement for the deprecated Exa search common tools.
  37. v2.14.0 Jul 21, 2026 · issue -029

    PydanticAI v2.14.0 adds Mistral reasoning_effort support and three new durability capability classes.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.14.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.14.0
    • Adds reasoning_effort support to the Mistral provider via thinking settings, enabling control over model reasoning depth.
    • Adds TemporalDurability, DBOSDurability, and PrefectDurability capability classes to replace the deprecated durability wrapper agents.
  38. v2.13.0 Jul 18, 2026 · issue -032

    PydanticAI v2.13.0 adds instrumentation controls, content-filter error raising, cache-hit ratio tracking, and new capability hooks.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.13.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.13.0
    └──▷ USE IT
    Suppress large span attributes in high-volume tracing pipelines by omitting model_request_parameters from OTel spans.
    python
    from pydantic_ai.settings import InstrumentationSettings
    
    settings = InstrumentationSettings(include_model_request_parameters=False)
    • Adds include_model_request_parameters instrumentation setting to control whether the model_request_parameters span attribute is included in traces.
    • Adds RaiseContentFilterError capability to raise an error when a non-empty content filter response is returned by the model.
    • Adds cache_hit_ratio property to RequestUsage and RunUsage for tracking cache efficiency across requests and runs.
    • Adds get_model, resolve_model_id, and for_agent capability hooks for customising model resolution and agent binding.
  39. v2.12.0 Jul 17, 2026 · issue -033

    PydanticAI v2.12.0 adds Kimi-K3 model support and two new agent stream events for deferred tools and enqueued messages.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.12.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.12.0
    └──▷ USE IT
    Observe deferred tool calls and their results while streaming an agent run, useful for auditing async/human-in-the-loop tool workflows.
    python
    async with agent.run_stream(prompt) as stream:
        async for event in stream.stream_events():
            if isinstance(event, DeferredToolCallEvent):
                print('Tool deferred:', event)
            elif isinstance(event, DeferredToolResultEvent):
                print('Deferred result received:', event)
            elif isinstance(event, EnqueuedMessagesEvent):
                print('Enqueued messages delivered:', event)
    • Adds DeferredToolCallEvent and DeferredToolResultEvent to AgentStreamEvent, enabling stream-level visibility into deferred tool call lifecycle.
    • Emits EnqueuedMessagesEvent when previously enqueued messages are delivered into a run, making message-replay observable in the event stream.
    • Adds Moonshot AI kimi-k3 model support.
  40. v2.11.0 Jul 16, 2026 · issue -034

    PydanticAI v2.11.0 exports HistoryProcessor and adds actionable hints to usage-limit and tool-retry errors.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.11.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.11.0
    └──▷ USE IT
    Import HistoryProcessor directly to build a custom history filter that trims old messages before each agent run.
    python
    from pydantic_ai import HistoryProcessor
    • Exports HistoryProcessor from the public API, making it directly importable for custom conversation-history handling.
    • Adds actionable hint messages to usage-limit and tool-retry errors, surfacing guidance at the point of failure.
  41. v2.10.0 Jul 15, 2026 · issue -035

    PydanticAI v2.10.0 adds automatic message-history repair and OpenAI background mode plus Anthropic pause-turn support.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.10.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.10.0
    • Supports OpenAI background mode and handles Anthropic stop_reason=pause_turn in agent runs.
  42. v2.9.0 Jul 11, 2026 · issue -039

    PydanticAI v2.9.0 adds a /usage CLI command, GPT-5.6 + reasoning mode support, and usage_limits exposure on RunContext.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.9.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.9.0
    └──▷ USE IT
    Inspect the active run's token limits inside a tool to short-circuit expensive work before hitting the cap.
    python
    from pydantic_ai import Agent, RunContext
    
    agent = Agent('openai:gpt-4o')
    
    @agent.tool
    async def my_tool(ctx: RunContext[None]) -> str:
        limits = ctx.usage_limits
        if limits and limits.response_tokens_limit and limits.response_tokens_limit < 500:
            return 'Skipping — too close to token limit'
        return 'Proceeding with full response'
    Check cumulative token consumption mid-session in the clai interactive CLI.
    $ /usage
    • Exposes usage_limits on RunContext so tools and capabilities can inspect the current run's token/request limits at call time.
    • Adds /usage slash command to the clai CLI to display cumulative token usage across a session.
    • Adds GPT-5.6 models and reasoning mode support to the OpenAI provider.
  43. v2.8.0 Jul 10, 2026 · issue -040

    PydanticAI v2.8.0 lets to_cli() accept a model override and bumps the bundled chat UI to 2.0.0.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.8.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.8.0
    └──▷ USE IT
    Run a model-agnostic agent from the CLI by supplying the model at invocation time.
    python
    agent.to_cli(model='openai:gpt-4o')
    • Adds model parameter to to_cli() so agents defined without a model can have one supplied at CLI invocation time.
    • Bumps bundled chat UI to 2.0.0 and targets sdk_version=7 in Agent.to_web().
  44. v2.7.0 Jul 9, 2026 · issue -041

    PydanticAI v2.7.0 adds azure-responses shorthand and xAI grok-4.5 model support.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.7.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.7.0
    └──▷ USE IT
    Use the azure-responses shorthand to target a specific Azure-hosted model without verbose configuration.
    python
    model = 'azure-responses:gpt-4o'
    • Supports azure-responses:[model-id] shorthand for specifying Azure Responses API models.
    • Adds xAI grok-4.5 model support.
  45. v2.6.0 Jul 8, 2026 · issue -042

    PydanticAI v2.6.0 adds time-to-first-token tracking, file uploads to CodeExecutionTool, and new Bedrock model profiles.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.6.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.6.0
    • Adds files support to CodeExecutionTool for Anthropic and OpenAI providers, enabling file uploads alongside code execution requests.
    • Records time-to-first-token for streaming model requests, exposing a new latency metric for streaming runs.
    • Adds Bedrock model profiles for Writer, Z.AI, and Moonshot AI, and refreshes LatestBedrockModelNames with current model listings.
  46. v2.5.0 Jul 4, 2026 · issue -046

    PydanticAI v2.5.0 adds sanitize_messages for message-history hardening and multimodal tool-return round-trips in AG-UI and Vercel AI adapters.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.5.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.5.0
    • Adds sanitize_messages for inbound message-history hardening, closing a dangling-tool-call re-exposure on the Agent.to_ag_ui() / AGUIAdapter serving path.
    • Supports round-trip multimodal tool returns through the AG-UI and Vercel AI adapters, covering both history and streaming paths.
  47. v2.4.0 Jul 3, 2026 · issue -047

    PydanticAI v2.4.0 adds GEval, five agentic span evaluators, and splits file-upload security controls into two distinct parameters.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.4.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.4.0
    • Splits preserve_file_data into allow_uploaded_files (inbound security control) and a separate AG-UI representation opt-in parameter, giving finer-grained control over uploaded file handling.
    • Adds GEval evaluator and standard quality metric rubrics for LLMJudge, enabling criteria-driven LLM-as-judge scoring.
    • Adds five agentic span-based evaluators — ToolCorrectness, TrajectoryMatch, ArgumentCorrectness, MaxToolCalls, and MaxModelRequests — for evaluating agent execution traces.
    └──▷ BREAKING ON UPGRADE
    • !The preserve_file_data parameter is split into allow_uploaded_files and an AG-UI opt-in; code referencing preserve_file_data will break on upgrade.
  48. v2.3.0 Jul 2, 2026 · issue -048

    PydanticAI v2.3.0 adds a native Z.AI (Zhipu AI) provider with thinking support.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.3.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.3.0
    • Adds native Z.AI (Zhipu AI) provider with thinking support.
  49. v2.2.0 Jul 1, 2026 · issue -049

    PydanticAI v2.2.0 adds Claude Sonnet 5 support, retry options for GoogleProvider, factory functions for Dataset.evaluate, and OpenRouter cost fields.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.2.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.2.0
    └──▷ USE IT
    Run a dataset evaluation with a factory function as the lifecycle argument to get a fresh lifecycle object per run.
    python
    await dataset.evaluate(
        task=my_task,
        lifecycle=lambda: MyEvalLifecycle(),
    )
    • Adds retry_options parameter to GoogleProvider for configurable retry behavior.
    • Adds prompt and completions cost fields to OpenRouter model responses.
    • Supports claude-sonnet-5 as a new model identifier for Anthropic Claude Sonnet 5.
    • Allows factory functions as the lifecycle argument in Dataset.evaluate, enabling dynamic lifecycle object creation per evaluation run.
    • Adds a TwelveLabs Pegasus video-understanding integration example.
  50. v2.1.0 Jun 29, 2026 · issue -051

    PydanticAI v2.1.0 adds Anthropic web tools with server-tool replay, TypeAdapter for EvaluatorContext, and improved instrumentation serialization.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.1.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.1.0
    • Adds TypeAdapter support for EvaluatorContext, enabling structured validation and serialization of evaluator context objects.
    • Adds Anthropic _20260209 web tools with server-tool replay support for the Anthropic provider.
    • Serializes instrumentation message attributes using to_json instead of json.dumps for more robust OpenTelemetry attribute handling.
  51. v2.0.0 Jun 23, 2026 · issue -057

    PydanticAI v2.0 stable: capabilities primitive, gemini-embedding-2, AG-UI deferred tools, and new model settings.

    └──▷ GET THIS VERSION
    $ git clone --branch v2.0.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v2.0.0
    • Adds xai_max_turns to XaiModelSettings to cap the number of turns for xAI model runs.
    • Adds gemini-embedding-2 embedding model support.
    • Adds google_task text-prefix conditioning for gemini-embedding-2 embeddings to tune retrieval, classification, and other task types.
    • Maps AG-UI interrupts to DeferredTools in AGUIAdapter, enabling human-in-the-loop interrupt handling in AG-UI workflows.
    • Introduces V2 stable with capabilities as a core composable primitive, bundling an agent's tools, hooks, instructions, and model settings into a single unit.
    +1 moreshow less
    • Adds cerebras_clear_thinking setting and emits reasoning_effort='none' for Cerebras to suppress chain-of-thought output.
  52. v1.107.0 Jun 10, 2026 · issue -070

    PydanticAI v1.107.0 adds known_model_names(), OpenRouter prompt caching, and two new Claude model aliases.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.107.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.107.0
    └──▷ USE IT
    Discover every model name PydanticAI recognises without reading source — useful for validation or building model-picker UIs.
    python
    from pydantic_ai import known_model_names
    
    for name in known_model_names():
        print(name)
    • Adds known_model_names() function to programmatically enumerate all KnownModelName members at runtime.
    • Adds CachePoint and prompt caching support for OpenRouter models.
    • Adds claude-fable-5 and claude-mythos-5 as supported model name aliases.
  53. v1.106.0 Jun 5, 2026 · issue -075

    PydanticAI v1.106.0 adds api_host, timeout, and seed support to XaiProvider

    └──▷ GET THIS VERSION
    $ git clone --branch v1.106.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.106.0
    └──▷ USE IT
    Point xAI at a custom host and set a request timeout when initializing the provider.
    python
    from pydantic_ai.providers.xai import XaiProvider
    
    provider = XaiProvider(
        api_host="https://my-xai-proxy.example.com",
        timeout=30,
    )
    Pin xAI model outputs to a fixed seed for reproducible results in evaluations or tests.
    python
    from pydantic_ai.providers.xai import XaiProvider
    from pydantic_ai import Agent
    
    agent = Agent(
        model="xai:grok-3",
        model_settings={"seed": 42},
        provider=XaiProvider(),
    )
    • Adds api_host and timeout parameters to XaiProvider, enabling custom endpoint and timeout configuration for xAI connections.
    • Maps the base seed setting to xAI via XaiProvider, enabling reproducible xAI model outputs.
  54. v1.105.0 Jun 2, 2026 · issue -078

    PydanticAI v1.105.0 adds on-demand deferred loading for agent capabilities and Grok 4.3 reasoning_effort support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.105.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.105.0
    • Adds reasoning_effort support for Grok 4.3 via xAI model settings, along with updated current xAI model names.
    • Introduces on-demand (deferred loading) capabilities, allowing instructions, tools, model settings, and hooks to be loaded lazily at runtime.
  55. v1.104.0 May 29, 2026 · issue -082

    PydanticAI v1.104.0 adds Claude Opus 4.8 model support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.104.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.104.0
    • Adds support for Claude Opus 4.8 as a usable model.
  56. v1.103.0 May 27, 2026 · issue -084

    PydanticAI v1.103.0 adds MCP prompt listing, Vercel timestamp round-tripping, and OpenRouter eager streaming support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.103.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.103.0
    └──▷ USE IT
    Enable eager input streaming when using Anthropic-compatible models via OpenRouter to reduce time-to-first-token.
    python
    from pydantic_ai.models.openrouter import OpenRouterModel
    
    model = OpenRouterModel(
        'anthropic/claude-3-5-sonnet',
        anthropic_eager_input_streaming=True,
    )
    • Adds list_prompts and get_prompt methods to McpServer, enabling MCP clients to discover and retrieve prompts from a server.
    • Supports anthropic_eager_input_streaming in OpenRouterModel, bringing eager input streaming parity with the native Anthropic model.
    • Round-trips message timestamps through VercelAIAdapter's UIMessage.metadata, preserving original message timing across the adapter boundary.
  57. v1.101.0 May 22, 2026 · issue -089

    PydanticAI v1.101.0 adds a pending message queue, MCP background tasks, model-agnostic XSearch, and top_k support across three model providers.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.101.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.101.0
    └──▷ USE IT
    Inject a follow-up message into a running agent mid-execution using the new pending message queue.
    python
    agent_run.enqueue("Please also summarize in bullet points.")
    • Adds ctx.enqueue and agent_run.enqueue for a pending message queue, enabling mid-run message injection into agent execution.
    • Adds top_k model setting support to GoogleModel, AnthropicModel, and CohereModel.
    • Adds MCP background task support (SEP-1686) via the MCPServer integration.
    • Makes XSearch capability model-agnostic through a subagent fallback, removing the previous model-specific constraint.
  58. v1.100.0 May 21, 2026 · issue -090

    PydanticAI v1.100.0 adds Bedrock native JSON output and strict tool calls support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.100.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.100.0
    • Adds support for Bedrock native JSON output and strict tool calls via the Bedrock integration.
  59. v1.99.0 May 20, 2026 · issue -091

    PydanticAI v1.99.0 adds support for the gemini-3.5-flash model.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.99.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.99.0
    • Adds gemini-3.5-flash as a supported model.
  60. v1.98.0 May 19, 2026 · issue -092

    PydanticAI v1.98.0 adds OpenAI Responses token counting and a unified retries parameter on Agent.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.98.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.98.0
    └──▷ USE IT
    Count input tokens for an OpenAI Responses model request before committing to the API call.
    python
    from pydantic_ai.models.openai import OpenAIResponsesModel
    
    model = OpenAIResponsesModel('gpt-4o')
    token_count = await model.count_tokens(messages, model_settings=None)
    • Adds OpenAIResponsesModel.count_tokens method to count input tokens for OpenAI Responses model calls before sending them.
    • Replaces Agent parameters tool_retries= and output_retries= with a single retries: int | AgentRetries parameter, enabling unified retry control across tools and outputs.
    └──▷ BREAKING ON UPGRADE
    • !The Agent constructor parameters tool_retries= and output_retries= are replaced by retries: int | AgentRetries; code passing either removed keyword argument will break on upgrade.
  61. v1.97.0 May 15, 2026 · issue -096

    PydanticAI v1.97.0 adds MCPToolset, OnlineEvaluator error opt-in, streaming state tracking, and splits GoogleProvider into two classes.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.97.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.97.0
    └──▷ USE IT
    Evaluate agent calls that raised errors, not just successful completions, to catch failure-mode regressions.
    python
    evaluator = OnlineEvaluator(run_on_errors=True)
    • Adds OnlineEvaluator.run_on_errors flag to opt into running evaluations on failed (errored) agent calls, not just successful ones.
    • Adds MCPToolset (backed by fastmcp-slim[client]) as the new MCP integration class, replacing the deprecated MCPServer* and FastMCPToolset.
    • Splits GoogleProvider(vertexai=True|False) into two separate classes: GoogleProvider (formerly google-gla:, now provider ID google:) and GoogleCloudProvider (formerly google-vertex:, now provider ID google-cloud:).
    • Sets ModelResponse.state to incomplete while a response is still streaming, enabling callers to distinguish in-progress from finished responses.
    • Promotes pydantic_graph.beta API out of beta into the stable namespace.
    +2 moreshow less
    • Adds stream_response() (singular) as the replacement for stream_responses(); the new method yields ModelResponse directly instead of a (ModelResponse, is_last) tuple.
    • Replaces the bundled fasta2a A2A integration with an external fasta2a.pydantic_ai adapter (requires fasta2a v0.6.1+), following DataLayer's adoption of the project.
    └──▷ BREAKING ON UPGRADE
    • !The google-gla: provider ID is renamed to google: and google-vertex: is renamed to google-cloud:; old names are deprecated and will be removed in v2.
    • !stream_responses() is deprecated in favor of stream_response(); the new singular form yields ModelResponse instead of (ModelResponse, is_last), so any code unpacking the tuple will break when migrated.
    • !Agent.to_a2a() and the bundled fasta2a integration are deprecated; users must switch to fasta2a.pydantic_ai (requires fasta2a v0.6.1) from the external package.
    • !The pydantic_graph.beta module is deprecated; import paths that relied on the .beta namespace must be updated to the stable API.
  62. v1.95.0 May 13, 2026 · issue -098

    PydanticAI v1.95.0 adds native Tool Search on Anthropic/OpenAI, an Instrumentation capability class, and Gemini 3 structured-output + tool combinations.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.95.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.95.0
    └──▷ USE IT
    Register a native tool and instrumentation together using the new capabilities= API instead of deprecated per-argument options.
    python
    agent = Agent(
        'openai:gpt-4o',
        capabilities=[NativeTool(...), Instrumentation(...)]
    )
    • Adds native Tool Search support for Anthropic and OpenAI providers, with custom search strategies available on any provider.
    • Introduces the Instrumentation capability class; the existing Agent(instrument=...) parameter is now deprecated in favour of capabilities=[Instrumentation(...)].
    • Renames 'built-in tools' to 'native tools'; native tools are now registered via capabilities=[NativeTool(...)]; old fields are deprecated ahead of v2.
    • Adds local= opt-in parameter for provider-adaptive capability fallback; auto-fallback is deprecated.
    • Supports combining structured output and tool use together for Gemini 3 models via the Google provider.
  63. v1.94.0 May 12, 2026 · issue -099

    PydanticAI v1.94.0 adds openai_chat_supports_multiple_system_messages profile flag for OpenAI chat configuration.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.94.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.94.0
    • Adds openai_chat_supports_multiple_system_messages profile flag to control whether multiple system messages are supported in OpenAI chat requests.
    └──▷ BREAKING ON UPGRADE
    • !The mistralai package is no longer installed as a dependency of pydantic-ai; installations that relied on it being pulled in transitively must now declare it explicitly.
  64. v1.93.0 May 9, 2026 · issue -102

    PydanticAI v1.93.0 adds tool_choice setting and new output tool call events for structured agent control.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.93.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.93.0
    • Adds tool_choice setting to control which tool the model selects during agent runs.
    • Introduces OutputToolCallEvent and OutputToolResultEvent stream events for output tool calls, replacing deprecated function-tool events for failing output tool calls.
  65. v1.92.0 May 8, 2026 · issue -103

    PydanticAI v1.92.0 adds Anthropic task budget support and a runtime output_retries override for agents.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.92.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.92.0
    • Adds runtime output_retries override on agent runs, allowing per-call control of output retry counts without reconfiguring the agent; retries is now deprecated in favour of output_retries.
    • Adds Anthropic task budget support, enabling token/compute budget constraints on Anthropic-backed agent calls.
  66. v1.91.0 May 7, 2026 · issue -104

    PydanticAI v1.91.0 adds gpt-image-2 options for OpenAI and support for deepseek-v4-flash and deepseek-v4-pro models.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.91.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.91.0
    • Supports gpt-image-2 model options via the OpenAI provider.
    • Adds deepseek-v4-flash and deepseek-v4-pro to the DeepSeek provider.
  67. v1.90.0 May 5, 2026 · issue -106

    PydanticAI v1.90.0 adds OpenAI Conversations API state support and typed OTel metadata for tool call syntax highlighting.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.90.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.90.0
    └──▷ USE IT
    Resume a stateful OpenAI conversation across multiple agent calls by passing a stable conversation ID.
    python
    settings = OpenAIResponsesModelSettings(openai_conversation_id='<your-conversation-id>')
    result = await agent.run('Follow-up question', model_settings=settings)
    • Adds OpenAIResponsesModelSettings.openai_conversation_id to persist conversation state across turns using the OpenAI Conversations API.
    • Adds typed OpenTelemetry metadata for code tool call syntax highlighting, enabling richer tracing of tool invocations.
  68. v1.89.1 May 1, 2026 · issue -110

    PydanticAI v1.89.1 adds bundled Library Skills for improved coding-agent support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.89.1 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.89.1
    • Adds bundled Library Skills (library-skills.io) to improve coding-agent support and tool discovery.
  69. v1.89.0 May 1, 2026 · issue -110

    PydanticAI v1.89.0 adds cross-run conversation correlation, dynamic model capabilities, and builtin-tool overrides.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.89.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.89.0
    └──▷ USE IT
    Disable or replace builtin tools for a specific agent run, e.g. in tests or sandboxed environments.
    python
    with agent.override(builtin_tools=[]):
        result = await agent.run('What time is it?')
    • Adds conversation_id to enable cross-run correlation, linking multiple agent runs into a single logical conversation.
    • Adds builtin_tools parameter to agent.override(), allowing builtin tools to be overridden at runtime.
    • Supports dynamic model capabilities via callables in the capabilities list, enabling runtime-evaluated capability flags.
  70. v1.88.0 Apr 29, 2026 · issue -112

    PydanticAI v1.88.0 adds output validate/process hooks, cross-provider service_tier, Anthropic fast mode, and new UI sanitization APIs.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.88.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.88.0
    └──▷ USE IT
    Enforce consistent service priority across providers without per-model configuration.
    python
    from pydantic_ai import Agent
    
    agent = Agent(
        'anthropic:claude-opus-4-6',
        model_settings={'service_tier': 'priority'},
    )
    result = agent.run_sync('Summarize this document.')
    print(result.output)
    • Adds prepare_output_tools hook alongside prepare_toolsprepare_tools is now scoped to function tools only, while output validate/process hooks give fine-grained control over output tool execution.
    • Adds cross-provider service_tier model setting with support for Anthropic, Gemini API, and Vertex Priority PayGo.
    • Adds fast speed mode for Anthropic Opus 4.6.
    • Adds UIAdapter.sanitize_messages and allowed_file_url_schemes to the UI adapter for controlling which file URL schemes are permitted in messages.
    • Supports OpenAI Responses phase field on assistant messages.
    └──▷ BREAKING ON UPGRADE
    • !prepare_tools is now scoped to function tools only; callers relying on it to prepare output tools must migrate to the new prepare_output_tools hook.
  71. v1.87.0 Apr 25, 2026 · issue -116

    PydanticAI v1.87.0 adds deferred tool call handling, event stream processing capability, and GPT-5.5 thinking support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.87.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.87.0
    • Adds HandleDeferredToolCalls capability and handle_deferred_tool_calls hook for handling deferred tool calls in agent workflows.
    • Adds ProcessEventStream capability for processing event streams from model responses.
    • Supports the thinking setting for GPT-5.5 models.
  72. v1.86.0 Apr 23, 2026 · issue -118

    PydanticAI v1.86.0 adds UIAdapter.manage_system_prompt and ReinjectSystemPrompt for dynamic system prompt control in UI adapters.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.86.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.86.0
    • Adds UIAdapter.manage_system_prompt method and ReinjectSystemPrompt capability, enabling UI adapters to control and reinject system prompts at runtime.
  73. v1.85.0 Apr 21, 2026 · issue -120

    PydanticAI v1.85.0 adds online evaluation surfaced through OpenTelemetry events.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.85.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.85.0
    • Adds online evaluation via OpenTelemetry events, enabling real-time assessment of agent runs as telemetry data.
  74. v1.84.0 Apr 17, 2026 · issue -124

    PydanticAI v1.84.0 adds Claude Opus 4.7 support, stateful compaction for OpenAI, and a dedicated OllamaModel subclass.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.84.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.84.0
    • Adds OllamaModel subclass with corrected Ollama capability flags, enabling reliable structured output on Ollama Cloud.
    • Adds stateful compaction mode to OpenAICompaction for managing conversation context across long runs.
    • Adds support for the Claude Opus 4.7 model.
  75. v1.83.0 Apr 16, 2026 · issue -125

    PydanticAI v1.83.0 adds xAI tool support, FastMCP metadata injection, Bedrock/Anthropic prompt caching, and a graceful parallel-tool end strategy.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.83.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.83.0
    └──▷ USE IT
    Use the graceful end strategy so a parallel tool run completes in-flight calls before stopping, rather than cancelling abruptly.
    python
    agent = Agent(model=model, end_strategy='graceful')
    Declare an agent whose output may be a plain string or absent, avoiding a required structured-output wrapper.
    python
    agent = Agent(model=model, output_type=str | None)
    • Adds XSearchTool and FileSearch support for the xAI provider.
    • Adds metadata injection per tool call via FastMCPToolset.
    • Adds prompt cache TTL support for the Bedrock provider.
    • Adds automatic prompt caching support for Anthropic.
    • Adds a 'graceful' end strategy for parallel tool calls.
    +1 moreshow less
    • Supports Agent(output_type=str | None) for optional agent output.
  76. v1.80.0 Apr 10, 2026 · issue -131

    PydanticAI v1.80.0 adds capability ordering, hooks ordering, and server-side context compaction for OpenAI and Anthropic

    └──▷ GET THIS VERSION
    $ git clone --branch v1.80.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.80.0
    └──▷ USE IT
    Use OpenAICompaction to automatically compact context on the server side when approaching token limits with an OpenAI model.
    python
    from pydantic_ai.capabilities import OpenAICompaction
    
    agent = Agent(
        'openai:gpt-4o',
        capabilities=[OpenAICompaction()],
    )
    Declare that one capability must wrap another using CapabilityOrdering to enforce a guaranteed composition order.
    python
    from pydantic_ai.capabilities import CapabilityOrdering
    
    ordering = CapabilityOrdering(my_outer_capability, wraps=my_inner_capability)
    • Adds CapabilityOrdering with relationship descriptors innermost, outermost, wraps, wrapped_by, and requires to control how capabilities compose and resolve ordering.
    • Adds an ordering parameter to Hooks and supports instance references in wraps/wrapped_by for finer control over hook execution order.
    • Adds OpenAICompaction and AnthropicCompaction capability classes to enable server-side context window compaction for those providers.
  77. v1.79.0 Apr 10, 2026 · issue -131

    PydanticAI v1.79.0 adds AG-UI 0.1.13/0.1.15 support, a new async HTTP client factory, and apply() on capability classes.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.79.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.79.0
    └──▷ USE IT
    Use create_async_http_client as a context manager to control the lifetime of the shared async HTTP client explicitly.
    python
    from pydantic_ai.http import create_async_http_client
    
    async with create_async_http_client() as client:
        agent = MyAgent(http_client=client)
        result = await agent.run('Hello')
    • Adds create_async_http_client context manager to replace the internal HTTP client cache, giving callers explicit lifecycle control over async HTTP clients.
    • Adds apply() method to AbstractCapability, CombinedCapability, and WrapperCapability, enabling capabilities to be applied directly.
    • Adds full AG-UI 0.1.13 and 0.1.15 support, including reasoning, multi-modal messaging, and dump_messages.
  78. v1.78.0 Apr 8, 2026 · issue -133

    PydanticAI v1.78.0 adds return_schema, function_signature, and SetToolMetadata to ToolDefinition, plus OTel cached token span attributes.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.78.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.78.0
    └──▷ USE IT
    Inspect a tool's return schema and function signature at definition time to validate or log tool contracts.
    python
    from pydantic_ai.tools import ToolDefinition
    
    def my_tool(x: int) -> str:
        return str(x)
    
    td = ToolDefinition(
        name='my_tool',
        description='Converts int to str',
        parameters_json_schema={},
        return_schema=...,           # new field
        function_signature=...,      # new field
    )
    print(td.return_schema)
    print(td.function_signature)
    • Adds return_schema and function_signature fields to ToolDefinition, exposing richer tool metadata for inspection and downstream use.
    • Adds SetToolMetadata capability, enabling dynamic mutation of tool metadata at runtime.
    • Adds cached token span attributes to OTel traces per the OpenTelemetry specification, improving observability of token usage.
  79. v1.77.0 Apr 3, 2026 · issue -138

    PydanticAI v1.77.0 adds a local WebFetch tool, deferred tool loading, a ThreadExecutor capability, and smart Anthropic/Bedrock instruction caching.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.77.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.77.0
    └──▷ USE IT
    Defer tool loading so tools are only resolved at call time, enabling dynamic tool search before execution.
    python
    from pydantic_ai import Agent
    from pydantic_ai.tools import Tool
    
    def my_tool_fn(ctx, query: str) -> str:
        return f'result for {query}'
    
    tool = Tool(my_tool_fn, defer_loading=True)
    agent = Agent('openai:gpt-4o', tools=[tool])
    Run an agent in a thread executor to avoid blocking the event loop when integrating with sync-heavy workloads.
    python
    import asyncio
    from pydantic_ai import Agent
    
    agent = Agent('anthropic:claude-sonnet-4-5')
    
    async def main():
        async with agent.using_thread_executor():
            result = await agent.run('Summarize this document.')
        print(result.output)
    
    asyncio.run(main())
    • Adds defer_loading parameter to tools and toolsets, enabling lazy/deferred tool loading to support tool search workflows.
    • Adds Agent.using_thread_executor() method and a ThreadExecutor capability for running agents in thread executors.
    • Adds a local WebFetch tool that activates automatically when a provider lacks built-in web-fetch support, extending WebFetch capability to more providers.
    • Adds smart instruction caching for Anthropic and Bedrock providers — automatically inserts a cache boundary at the static/dynamic instruction split.
    • Adds support for server_message_id in VercelAIEventStream.
  80. v1.76.0 Apr 2, 2026 · issue -139

    PydanticAI v1.76.0 adds agent self-reference in RunContext and automatic image-generation fallback via subagent.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.76.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.76.0
    └──▷ USE IT
    Access the running agent from inside a tool via RunContext.agent — useful for dynamic dispatch or introspection without globals.
    python
    @agent.tool
    async def my_tool(ctx: RunContext[MyDeps]) -> str:
        current_agent = ctx.agent  # newly available in v1.76.0
        return f"Running as: {current_agent.name}"
    • Adds agent attribute to RunContext, giving tools and callbacks direct access to the running agent instance.
    • Adds automatic fallback for ImageGeneration: when the main model lacks image-generation capability, PydanticAI transparently delegates to a subagent running a dedicated imagegen model.
    • Updates the Mistral integration to support mistralai SDK v2.
  81. v1.75.0 Apr 1, 2026 · issue -140

    PydanticAI v1.75.0 adds Gemini embedding types/limits and Flex PayGo support for Vertex AI.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.75.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.75.0
    • Adds types and limits for gemini-embedding-2-preview in the embeddings module.
    • Implements support for Flex PayGo billing mode with the Vertex AI provider.
  82. v1.74.0 Mar 31, 2026 · issue -141

    PydanticAI v1.74.0 adds online evaluation infrastructure, TextContent metadata, time-sortable run IDs, and MCP Server instructions support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.74.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.74.0
    └──▷ USE IT
    Attach invisible metadata to a user prompt — useful for tagging messages with session or request context without leaking it to the model.
    python
    from pydantic_ai.messages import TextContent
    
    prompt = TextContent(text='Summarize this document.', metadata={'session_id': 'abc123', 'user_tier': 'pro'})
    result = await agent.run([prompt])
    • Adds AbstractToolset.get_instructions method and include_instructions argument to MCP Servers, enabling toolsets to surface dynamic instructions to agents.
    • Adds TextContent class for user prompts, supporting a metadata field that is attached to the content object but not sent to the model.
    • Introduces online evaluation infrastructure for pydantic-evals, enabling live/online evaluation workflows.
    • Makes agent run IDs time-sortable and propagates agent name and run ID as span attributes on all agent run child spans, improving observability.
  83. v1.73.0 Mar 27, 2026 · issue -145

    PydanticAI v1.73.0 adds CaseLifecycle hooks to Dataset.evaluate and lets hooks swap models or trigger retries.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.73.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.73.0
    └──▷ USE IT
    Retry a model request from within a hook when a validation condition is not met.
    python
    from pydantic_ai import ModelRetry
    
    def after_request(ctx):
        if not response_is_valid(ctx.response):
            raise ModelRetry('Response failed validation, retrying')
    • Adds CaseLifecycle hooks to Dataset.evaluate for lifecycle callbacks around each evaluation case.
    • Allows before/wrap model request hooks to swap the active model via ModelRequestContext.
    • Allows hooks to raise ModelRetry to control retry flow from within hook logic.
  84. v1.72.0 Mar 26, 2026 · issue -146

    PydanticAI v1.72.0 adds Anthropic eager input streaming, sync tool prep functions, and implicit MCP URLs

    └──▷ GET THIS VERSION
    $ git clone --branch v1.72.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.72.0
    └──▷ USE IT
    Enable eager input streaming for an Anthropic model when you want streamed responses to begin as soon as input is ready.
    python
    from pydantic_ai.models.anthropic import AnthropicModelSettings
    
    settings = AnthropicModelSettings(anthropic_eager_input_streaming=True)
    • Adds anthropic_eager_input_streaming to AnthropicModelSettings to control eager streaming behaviour for Anthropic models.
    • Supports synchronous tool preparation functions alongside existing async ones, removing the requirement to define async def for tool prep.
    • Removes the requirement to specify an explicit url= argument on the MCP capability, both in Python and in AgentSpec configuration.
  85. v1.71.0 Mar 24, 2026 · issue -148

    PydanticAI v1.71.0 adds Capabilities, AgentSpec, Hooks, Thinking, provider-adaptive tools, and two new OpenAI models.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.71.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.71.0
    └──▷ USE IT
    Load a fully-configured agent from a YAML file with templated instructions referencing runtime deps.
    python
    from pydantic_ai import Agent
    
    agent = Agent.from_file('my_agent.yaml')
    Isolate toolset state per run so concurrent agent calls do not share mutable tool state.
    python
    class MyToolset(AbstractToolset):
        async def for_run(self, ctx):
            return MyToolset(session=ctx.deps.session)
    
    agent = Agent('openai:gpt-5.4-nano', toolsets=[MyToolset()])
    • Adds Agent.from_file for loading agents from YAML/JSON files, with templated instructions that reference deps via TemplateStr.
    • Adds AbstractToolset.for_run and for_run_step methods for per-run and per-step state isolation in toolsets.
    • Adds Capabilities: composable, reusable units of agent behavior that bundle tools, lifecycle hooks, instructions, and model settings into a single class pluggable into any agent.
    • Adds AgentSpec for declarative agent definitions loadable from YAML/JSON.
    • Adds Hooks capability for defining lifecycle hooks using decorators.
    +3 moreshow less
    • Adds Thinking capability and a cross-provider thinking model setting.
    • Adds provider-adaptive tool capabilities WebSearch, WebFetch, MCP, and ImageGeneration that automatically fall back from builtin (provider) tools to local tools.
    • Adds openai:gpt-5.4-mini and openai:gpt-5.4-nano model identifiers.
  86. v1.70.0 Mar 18, 2026 · issue -154

    PydanticAI v1.70.0 adds bedrock_inference_profile to Bedrock model and embedding settings.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.70.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.70.0
    └──▷ USE IT
    Route Bedrock LLM calls through a specific inference profile, e.g. a cross-region profile, without changing your agent logic.
    python
    from pydantic_ai.models.bedrock import BedrockModelSettings
    
    settings = BedrockModelSettings(
        bedrock_inference_profile="us.anthropic.claude-3-5-sonnet-20241022-v2:0"
    )
    
    agent = Agent("bedrock:anthropic.claude-3-5-sonnet-20241022-v2:0", model_settings=settings)
    • Adds bedrock_inference_profile field to BedrockModelSettings and BedrockEmbeddingSettings, enabling inference profile selection for AWS Bedrock model and embedding calls.
  87. v1.69.0 Mar 17, 2026 · issue -155

    PydanticAI v1.69.0 adds agent descriptions for tracing, multimodal tool results, and response-based FallbackModel support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.69.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.69.0
    └──▷ USE IT
    Attach a human-readable description to an agent so tracing spans carry meaningful context in your observability backend.
    python
    agent = Agent(model='openai:gpt-4o', description='Summarises customer support tickets and routes to the correct team')
    • Adds response-based fallback support to FallbackModel, enabling fallback logic driven by the model response rather than only on errors.
    • Sends multimodal tool results to APIs directly as a single part instead of splitting them into user parts.
  88. v1.67.0 Mar 6, 2026 · issue -165

    PydanticAI v1.67.0 adds GPT-5.4 support, WebSearchTool for OpenRouter, a Tavily search overhaul, and native structured output for Ollama.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.67.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.67.0
    • Supports WebSearchTool for OpenRouterModel via OpenRouter plugins, enabling web search through the OpenRouter provider.
    • Enables native structured output support for the Ollama provider.
    • Adds GPT-5.4 model support.
    • Rehauled TavilySearchTool with updated internals and capabilities.
  89. v1.66.0 Mar 5, 2026 · issue -166

    PydanticAI v1.66.0 adds native structured output for Qwen 3.5 models and support for the Gemini image-preview model.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.66.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.66.0
    • Enables native structured output for Qwen 3.5 models.
    • Adds support for gemini-3.1-flash-image-preview (Nano Banana 2) as a supported model.
  90. v1.65.0 Mar 3, 2026 · issue -168

    PydanticAI v1.65.0 adds provider-uploaded file support via UploadedFile and the gemini-3.1-flash-lite-preview model.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.65.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.65.0
    • Adds UploadedFile object to support files uploaded directly to providers, enabling agents to work with provider-hosted file references.
    • Adds gemini-3.1-flash-lite-preview as a supported model identifier.
  91. v1.64.0 Mar 2, 2026 · issue -169

    PydanticAI v1.64.0 adds template=False on PromptedOutput and NativeOutput to suppress schema prompts.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.64.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.64.0
    └──▷ USE IT
    Suppress the auto-generated schema prompt on a structured output when you are supplying your own formatting instructions.
    python
    from pydantic_ai import PromptedOutput
    
    output = PromptedOutput(MyModel, template=False)
    • Adds template=False parameter to PromptedOutput and NativeOutput to disable automatic schema prompt injection when you want full control over the model prompt.
  92. v1.63.0 Feb 23, 2026 · issue -175

    PydanticAI v1.63.0 adds args_validator for tools, Gemini 2.5 Pro Preview support, and Gemini logprob output.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.63.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.63.0
    • Adds args_validator parameter to tool definitions for pre-execution argument validation before a tool runs.
    • Adds logprob support for Gemini models.
  93. v1.62.0 Feb 19, 2026 · issue -179

    PydanticAI v1.62.0 adds tool approval for Vercel AI, plus LinePlot, ROCAUCEvaluator, and KolmogorovSmirnovEvaluator.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.62.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.62.0
    • Adds LinePlot analysis type, ROCAUCEvaluator, and KolmogorovSmirnovEvaluator for evaluating model outputs with statistical analysis.
    • Adds tool approval integration for the Vercel AI adapter, enabling human-in-the-loop approval flows for tool calls.
  94. v1.61.0 Feb 18, 2026 · issue -180

    PydanticAI v1.61.0 adds Python 3.14 support and Claude Sonnet 4.6 via updated Anthropic SDK.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.61.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.61.0
    • Supports Python 3.14.
    • Adds Claude Sonnet 4.6 model availability via Anthropic SDK upgrade to 0.80.0.
  95. v1.60.0 Feb 17, 2026 · issue -181

    PydanticAI v1.60.0 adds video URL support to OpenRouterModel and upgrades OTel instrumentation for multimodal input.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.60.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.60.0
    • Adds video_url support to OpenRouterModel, enabling video content to be passed as multimodal input through OpenRouter.
    • Upgrades instrumentation to version 4 to align with OTel GenAI semantic conventions for multimodal input.
  96. v1.59.0 Feb 14, 2026 · issue -184

    PydanticAI v1.59.0 adds Model.model_id, aggregated usage flag, BaseModel support in Contains, and Vercel AI metadata injection

    └──▷ GET THIS VERSION
    $ git clone --branch v1.59.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.59.0
    └──▷ USE IT
    Inspect which provider and model a configured agent is using at runtime, without string-parsing.
    python
    print(model.model_id)  # e.g. 'openai:gpt-4o'
    • Adds Model.model_id property that returns the model identifier in provider:model format.
    • Adds opt-in flag for aggregated usage attribute names.
    • Enhances Contains evaluator to support pydantic.BaseModel instances as expected values.
    • Allows BaseChunks to be injected into the Vercel AI adapter through ToolReturnPart.metadata.
  97. v1.58.0 Feb 11, 2026 · issue -187

    PydanticAI v1.58.0 adds report-level evaluators, multi-run aggregation, and extra_headers for Google provider

    └──▷ GET THIS VERSION
    $ git clone --branch v1.58.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.58.0
    └──▷ USE IT
    Pass custom headers (e.g. for tracing or billing) when using the Google model provider.
    python
    from pydantic_ai.models.google import GoogleModel
    
    model = GoogleModel('gemini-2.0-flash', extra_headers={'X-My-Trace-Id': 'abc123'})
    Re-run each evaluation case multiple times and aggregate results to reduce variance in LLM scoring.
    python
    from pydantic_evals import Dataset
    
    results = await dataset.evaluate(pipeline, repeat=5)
    • Adds extra_headers support to the Google model provider, enabling custom HTTP headers on requests.
    • Adds a repeat parameter to pydantic-evals for multi-run aggregation, enabling statistical analysis across repeated experiment runs.
    • Introduces report-level evaluators and experiment-wide analyses to pydantic-evals, enabling summary metrics across all cases in an evaluation run.
  98. v1.56.0 Feb 6, 2026 · issue -192

    PydanticAI v1.56.0 adds Claude Opus 4.6 support, adaptive thinking, and new Anthropic model settings fields.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.56.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.56.0
    └──▷ USE IT
    Enable adaptive extended thinking on a Claude Opus 4.6 call to let the model self-determine reasoning depth.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.anthropic import AnthropicModel, AnthropicModelSettings
    
    agent = Agent(
        AnthropicModel('claude-opus-4-6'),
        model_settings=AnthropicModelSettings(
            anthropic_effort='auto',
            anthropic_thinking={'type': 'adaptive'}
        )
    )
    result = agent.run_sync('Explain quantum entanglement.')
    print(result.output)
    Opt into an Anthropic beta feature (e.g. a preview API) on a per-agent basis using anthropic_betas.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.anthropic import AnthropicModel, AnthropicModelSettings
    
    agent = Agent(
        AnthropicModel('claude-opus-4-6'),
        model_settings=AnthropicModelSettings(
            anthropic_betas=['interleaved-thinking-2025-05-14']
        )
    )
    result = agent.run_sync('Draft a threat model for a SaaS API.')
    print(result.output)
    • Adds anthropic_effort and anthropic_thinking.type='adaptive' to Anthropic model settings, enabling adaptive extended thinking for Claude models.
    • Adds anthropic_betas field to AnthropicModelSettings, allowing opt-in to Anthropic beta features per request.
    • Adds support for Claude Opus 4.6 as a new model option.
  99. v1.54.0 Feb 4, 2026 · issue -194

    PydanticAI v1.54.0 adds concurrency limiting for Agents and Models

    └──▷ GET THIS VERSION
    $ git clone --branch v1.54.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.54.0
    • Adds concurrency limiting for Agents and Models to cap parallel executions and prevent resource exhaustion.
  100. v1.53.0 Feb 4, 2026 · issue -194

    PydanticAI v1.53.0 automatically infers the gateway base URL from the token region.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.53.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.53.0
    • Automatically infers the gateway base URL from the token region, removing the need to manually specify it.
  101. v1.52.0 Feb 3, 2026 · issue -195

    PydanticAI v1.52.0 adds OpenAI data-retention control, retry counts in run context, and reasoning-content passthrough.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.52.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.52.0
    └──▷ USE IT
    Disable OpenAI data retention for a model when handling sensitive workloads.
    python
    from pydantic_ai.models.openai import OpenAIChatModel
    
    model = OpenAIChatModel('gpt-4o', openai_store=False)
    • Adds openai_store setting to OpenAIChatModel to control whether OpenAI retains request/response data.
    • Exposes the number of output-validation retries in the agent's run context, making retry count available to tool and result handlers.
    • Makes OpenAIChatModel return reasoning content via the same field it was received in, preserving round-trip fidelity of reasoning tokens.
  102. v1.51.0 Jan 31, 2026 · issue -198

    PydanticAI v1.51.0 adds html_source parameter to customize the Chat UI source.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.51.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.51.0
    • Adds html_source parameter to the Chat UI to allow customization of the HTML source rendered by the chat interface.
  103. v1.50.0 Jan 29, 2026 · issue -200

    PydanticAI v1.50.0 exposes usage limits and model settings to CLI users and adds OpenAI raw text annotation access.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.50.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.50.0
    • Adds usage_limits and model_settings parameters accessible to users running agents with to_cli(), enabling runtime control of limits and settings from the command line.
    • Adds a setting to include OpenAI raw text annotations in TextPart.provider_details, surfacing provider-level annotation data to callers.
  104. v1.49.0 Jan 29, 2026 · issue -200

    PydanticAI v1.49.0 adds BedrockEmbeddingModel for Nova/Cohere/Titan and parallel tool calls in DBOSAgent.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.49.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.49.0
    └──▷ USE IT
    Generate embeddings via AWS Bedrock's Nova, Cohere, or Titan endpoints using the new BedrockEmbeddingModel.
    python
    from pydantic_ai.models.bedrock import BedrockEmbeddingModel
    
    model = BedrockEmbeddingModel('amazon.nova-lite-v1')
    result = await model.embed(['Hello, world!'])
    • Adds BedrockEmbeddingModel class supporting AWS Bedrock embedding endpoints for Nova, Cohere, and Titan models.
    • Enables parallel tool call execution in DBOSAgent.
    • Updates Vercel AI SDK type definitions to match AI SDK v6.
  105. v1.48.0 Jan 27, 2026 · issue -202

    PydanticAI v1.48.0 adds domain allowlisting for WebSearchTool, continuous usage stats for OpenAI, and model_settings support for Mistral streaming.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.48.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.48.0
    └──▷ USE IT
    Restrict an OpenAI web search agent to only retrieve results from trusted domains, reducing noise from untrusted sources.
    python
    from pydantic_ai.tools.web_search import WebSearchTool
    
    tool = WebSearchTool(allowed_domains=["example.com", "docs.openai.com"])
    Enable per-chunk token accounting during OpenAI streaming to monitor costs in real time.
    python
    from pydantic_ai import Agent
    
    agent = Agent(
        "openai:gpt-4o",
        model_settings={"continuous_usage_stats": True},
    )
    • Adds allowed_domains parameter to WebSearchTool to restrict OpenAI web searches to specific domains.
    • Adds continuous_usage_stats model setting for OpenAI to receive token usage statistics on every streamed chunk.
    • Applies model_settings to Mistral streaming JSON mode, enabling per-request model configuration during Mistral streaming.
  106. v1.47.0 Jan 24, 2026 · issue -205

    PydanticAI v1.47.0 preserves thought signatures and provider metadata through Vercel AI frontend round trips.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.47.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.47.0
    • Thought signatures and other provider metadata now survive a round trip through a Vercel AI frontend.
  107. v1.46.0 Jan 22, 2026 · issue -207

    PydanticAI v1.46.0 adds a native xAI SDK model class, replacing the OpenAI-compatible Grok provider.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.46.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.46.0
    • Adds XaiModel class that integrates with the xAI SDK natively, replacing the deprecated GrokProvider which relied on the OpenAI-compatible API.
    └──▷ BREAKING ON UPGRADE
    • !GrokProvider is deprecated; callers should migrate to XaiModel which uses the xAI SDK directly.
  108. v1.45.0 Jan 22, 2026 · issue -207

    PydanticAI v1.45.0 adds VoyageAI embeddings support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.45.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.45.0
    • Adds VoyageAI embeddings support as a new integration.
  109. v1.44.0 Jan 17, 2026 · issue -212

    PydanticAI v1.44.0 adds Exa search tools integration and AWS Bedrock Nova 2.0 Code Interpreter support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.44.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.44.0
    • Adds Exa search tools integration, enabling agents to perform web search via the Exa API as a built-in tool.
    • Adds support for the AWS Bedrock Nova 2.0 built-in Code Interpreter tool, allowing agents backed by Bedrock Nova 2.0 to execute code natively.
  110. v1.43.0 Jan 15, 2026 · issue -214

    PydanticAI v1.43.0 adds support for Google embedding models.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.43.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.43.0
    • Supports Google embedding models, enabling text embedding workflows via the Google provider.
  111. v1.42.0 Jan 14, 2026 · issue -215

    PydanticAI v1.42.0 adds SambaNova provider, ContentFilterError for empty responses, and OTel GenAI semantic attributes.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.42.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.42.0
    └──▷ USE IT
    Catch content-filter rejections explicitly instead of handling empty or opaque responses.
    python
    from pydantic_ai.exceptions import ContentFilterError
    
    try:
        result = await agent.run('Generate something sensitive')
    except ContentFilterError as e:
        print(f'Model blocked the response: {e}')
    • Raises ContentFilterError consistently when a model returns an empty response due to a content filter, giving callers a typed exception to catch.
    • Adds SambaNova as a supported provider.
    • Adds OpenTelemetry GenAI semantic convention attributes to telemetry output.
  112. v1.41.0 Jan 10, 2026 · issue -219

    PydanticAI v1.41.0 adds YAML/TOML media type support in BinaryContent and metadata for DeferredToolResults.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.41.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.41.0
    └──▷ USE IT
    Load a YAML file as binary content to pass structured data directly into an agent.
    python
    BinaryContent.from_path('config.yaml')
    • Adds YAML and TOML media type support to BinaryContent.from_path, enabling those file types to be loaded as binary content.
    • Adds metadata support for DeferredToolResults, allowing metadata to be attached to deferred tool result objects.
  113. v1.40.0 Jan 7, 2026 · issue -222

    PydanticAI v1.40.0 adds human-readable Temporal activity summaries and configurable retries for nonexistent tool calls.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.40.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.40.0
    • Agents now retry calls to nonexistent tools up to the Agent retries limit, matching the existing retry behavior for real tools.
    • Sets human-readable activity summaries for Temporal activities, improving observability in Temporal-based agent workflows.
  114. v1.39.0 Dec 24, 2025 · issue -236

    PydanticAI v1.39.0 adds embedding model support, agent run metadata on results and spans, and a new BedrockModelSettings tier field.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.39.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.39.0
    └──▷ USE IT
    Set a specific AWS Bedrock service tier on a model to control throughput or priority for an agent run.
    python
    from pydantic_ai.models.bedrock import BedrockModelSettings
    
    settings = BedrockModelSettings(bedrock_service_tier='standard')
    result = await agent.run('Summarize this document', model_settings=settings)
    • Adds bedrock_service_tier setting to BedrockModelSettings for controlling AWS Bedrock service tier per agent run.
    • Adds agent and agent run metadata, exposed on result objects and OpenTelemetry span attributes.
    • Introduces embedding model support via new embedding model classes and APIs.
    • Supports ThinkingPart in MCP Sampling, enabling reasoning-aware model responses over the Model Context Protocol.
    • Allows system prompt functions to return None, treating it as a no-op rather than an error.
  115. v1.38.0 Dec 23, 2025 · issue -237

    PydanticAI v1.38.0 adds local timestamps to request/response models and typed RunContext support in TextOutput signatures.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.38.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.38.0
    • Adds typed RunContext[Deps] support in TextOutput function signatures, enabling dependency-injected output handlers.
    • Adds local timestamps to request and response models, with provider timestamps surfaced in provider_details.
    • Supports VideoUrl.vendor_metadata for GCS URIs on the Google Vertex provider.
  116. v1.37.0 Dec 20, 2025 · issue -240

    PydanticAI v1.37.0 adds runtime model switching and DynamicToolset for TemporalAgent, plus Vertex AI image output controls.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.37.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.37.0
    └──▷ USE IT
    Control image output format and compression when generating images with a Vertex AI Gemini model.
    python
    ImageGenerationTool(output_format='jpeg', output_compression=80)
    • Adds output_compression and output_format parameters to ImageGenerationTool for Vertex AI Gemini image models.
    • Enables TemporalAgent to switch model at agent.run-time, allowing per-run model selection.
    • Adds DynamicToolset support in Temporal, enabling runtime-defined tool sets for Temporal workflows.
    • Adds a model profile flag for APIs that support native output but still require JSON schema in instructions.
    • Updates known Groq model names to add production/preview variants and remove deprecated entries.
    +1 moreshow less
    • Sets a configurable message on ToolRetryError for clearer retry error reporting.
  117. v1.35.0 Dec 17, 2025 · issue -243

    PydanticAI v1.35.0 adds FileSearchTool, DashScopeProvider, AG-UI multimodal messages, and Gemini 3 Flash support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.35.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.35.0
    • Adds FileSearchTool class with support for OpenAI and Google backends, enabling file-search capabilities within PydanticAI agents.
    • Adds DashScopeProvider for Alibaba Cloud, plus audio input support for Qwen Omni models.
    • Adds size parameter to ImageGenerationTool for Gemini image models, controlling generated image dimensions.
    • Supports OpenAI reasoning summary option 'auto' for reasoning-capable models.
    • Adds Gemini 3 Flash model support.
    +2 moreshow less
    • Supports AG-UI multi-modal messages, enabling richer message types in AG-UI integrations.
    • Sets timestamps on AG-UI events for improved event traceability.
  118. v1.34.0 Dec 16, 2025 · issue -244

    PydanticAI v1.34.0 adds a Web Chat UI launchable via clai web or Agent.to_web(), plus FileUrl.force_download support for Anthropic and OpenAI Responses models.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.34.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.34.0
    └──▷ TRY IT
    Quickly spin up an interactive web chat interface for an existing agent without writing a frontend.
    $ clai web
    Programmatically launch the Web Chat UI from within Python for a configured agent.
    python
    from pydantic_ai import Agent
    
    agent = Agent('openai:gpt-4o', system_prompt='You are a helpful assistant.')
    agent.to_web()
    • Adds clai web CLI command and Agent.to_web() method to launch a Web Chat UI for any agent.
    • Supports FileUrl.force_download in AnthropicModel and OpenAIResponsesModel for forced file downloads.
    • Makes OpenRouterProvider and DeepSeekProvider __init__ overloads less restrictive, broadening valid initialization patterns.
  119. v1.33.0 Dec 16, 2025 · issue -244

    PydanticAI v1.33.0 adds native s3:// URL support in BedrockConverseModel and broadens instructions support across models.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.33.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.33.0
    • Passes s3:// file URLs directly to the API in BedrockConverseModel, enabling S3-hosted files to be referenced without pre-fetching.
    • Inserts agent instructions after system_prompts for models that don't natively support instructions, broadening the operational surface of the instructions field across providers.
  120. v1.32.0 Dec 13, 2025 · issue -247

    PydanticAI v1.32.0 adds tool timeouts, multi-agent Temporal workflow registration, and OTel log-based observability.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.32.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.32.0
    └──▷ USE IT
    Register multiple TemporalAgents to a single Temporal workflow so the worker can discover and run them.
    python
    class MyWorkflow:
        __pydantic_ai_agents__ = [research_agent, summary_agent]
    
        async def run(self) -> str:
            ...
    • Adds tool timeout support, allowing individual tools to be given a maximum execution duration.
    • Allows TemporalAgents to be registered to a Temporal workflow via the __pydantic_ai_agents__ field on a workflow class.
    • Extends end_strategy to apply to output tools in addition to regular tools, giving consistent early-exit behaviour across both tool types.
    • Replaces OpenTelemetry events with OTel logs for agent observability, aligning with the OTel logging data model.
    └──▷ BREAKING ON UPGRADE
    • !OTel events emitted by PydanticAI are replaced with OTel logs; any pipeline or backend that consumes the old event format will no longer receive those signals.
  121. v1.31.0 Dec 12, 2025 · issue -248

    PydanticAI v1.31.0 adds prompt caching for AWS Bedrock, Agent.output_json_schema(), custom MCP clientInfo, and GPT-5.2 support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.31.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.31.0
    └──▷ USE IT
    Retrieve the JSON schema for an agent's structured output to validate or document the expected response shape.
    python
    from pydantic_ai import Agent
    from pydantic import BaseModel
    
    class Answer(BaseModel):
        summary: str
        confidence: float
    
    agent = Agent('openai:gpt-4o', output_type=Answer)
    print(agent.output_json_schema())
    Use a plain model name string in LLMJudge instead of a model object, for quick evaluation scripting.
    python
    from pydantic_ai.evaluate import LLMJudge
    
    judge = LLMJudge(model='openai:gpt-4o')
    result = await judge.evaluate(question='Is Paris the capital of France?', answer='Yes')
    print(result)
    • Adds Agent.output_json_schema() method to retrieve the JSON schema for an agent's output type programmatically.
    • Adds provider_url field to ModelResponse, used by cost() to route cost calculations correctly across providers.
    • Adds prompt caching support for AWS Bedrock, reducing latency and token costs on repeated prompts.
    • Allows custom clientInfo when connecting to MCP servers, enabling clients to self-identify to MCP endpoints.
    • Allows model to be passed as a plain string in LLMJudge, simplifying evaluation setup.
    +1 moreshow less
    • Adds support for GPT-5.2 and bumps the OpenAI dependency to v2.11.0.
  122. v1.30.0 Dec 11, 2025 · issue -249

    PydanticAI v1.30.0 adds CerebrasModel, prompt caching options for OpenAI, and multi-modal output in LLMJudge.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.30.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.30.0
    • Adds CerebrasModel as a new supported LLM provider integration.
    • Adds prompt caching options to OpenAIChatModelSettings for controlling OpenAI prompt cache behavior.
    • Supports multi-modal output in LLMJudge evaluations.
  123. v1.29.0 Dec 10, 2025 · issue -250

    PydanticAI v1.29.0 adds aspect ratio support for Gemini image generation and passes container_id to the Anthropic API.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.29.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.29.0
    • Passes container_id back to the Anthropic API, enabling container-scoped tool interactions.
    • Adds aspect ratio support for Gemini image generation.
    • Removes the requirement for the anthropic dependency when using an Anthropic model through a third-party provider.
  124. v1.28.0 Dec 9, 2025 · issue -251

    PydanticAI v1.28.0 adds structured output for claude-haiku-4-5 and multi-character Bedrock geo-prefix support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.28.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.28.0
    • Adds native structured output support for claude-haiku-4-5.
    • Supports us-gov. and other multi-character AWS Bedrock geo prefixes.
  125. v1.27.0 Dec 5, 2025 · issue -255

    PydanticAI v1.27.0 adds dynamic built-in tool config via RunContext, MCP tool/resource caching, CoT reasoning support, and VercelAIAdapter message conversion.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.27.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.27.0
    └──▷ USE IT
    Convert a PydanticAI conversation history to Vercel AI message format for streaming to a Next.js frontend.
    python
    from pydantic_ai.adapters.vercel import VercelAIAdapter
    
    vercel_messages = VercelAIAdapter.dump_messages(result.all_messages())
    • Adds VercelAIAdapter.dump_messages() method to convert PydanticAI messages to Vercel AI message format.
    • Supports tool and resource caching for MCP servers that emit change notifications, reducing redundant round-trips.
    • Enables dynamic runtime configuration of built-in tools via RunContext, allowing per-run tool behavior without rebuilding agents.
    • Supports raw Chain-of-Thought (CoT) reasoning output from LM Studio and other OpenAI Responses-compatible APIs.
    • Uses a custom reasoning field for OpenRouter to surface model reasoning traces.
  126. v1.26.0 Dec 3, 2025 · issue -257

    PydanticAI v1.26.0 adds Grok models, custom OpenAI reasoning fields, Deepseek JSON output, and gateway model name support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.26.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.26.0
    • Adds custom reasoning field support to OpenAI model profiles, enabling configuration of reasoning behaviour for compatible models.
    • Adds gateway/...:... pattern to known model names, allowing gateway-routed models to be referenced by name without custom setup.
    • Supports JSON object output for the Deepseek provider, enabling structured response parsing from Deepseek models.
    • Adds latest Grok (xAI) models to the supported model list.
    • Automatically omits TTL from cache_control when AnthropicModel is used with a Bedrock client, preventing unsupported-field errors.
  127. v1.25.0 Nov 28, 2025 · issue -262

    PydanticAI v1.25.0 adds support for gemini-3-pro-image-preview and improved Google tool error reporting.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.25.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.25.0
    • Adds support for the gemini-3-pro-image-preview model.
    • Returns tool errors to Google in the error key, enabling structured error feedback in Google model integrations.
  128. v1.24.0 Nov 27, 2025 · issue -263

    PydanticAI v1.24.0 adds native JSON output for Anthropic, Pydantic validation context, logprobs from Responses API, and instructions-only agent runs.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.24.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.24.0
    • Supports instructions-only agent runs with OpenAIResponsesModel, enabling prompts without user message content.
    • Adds native JSON output and strict tool calls for Anthropic models.
    • Supports Pydantic validation context, allowing contextual data to be passed into validators during model output parsing.
    • Supports logprobs output from the OpenAI Responses API.
  129. v1.23.0 Nov 26, 2025 · issue -264

    PydanticAI v1.23.0 adds Anthropic WebFetchTool, cache-message settings, HITL user prompts, and Gemini 3 Pro via OpenRouter.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.23.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.23.0
    • Adds anthropic_cache_messages model setting for Anthropic models, with automatic stripping of cache points that exceed the provider limit.
    • Adds support for Anthropic's built-in WebFetchTool, enabling web-fetch capability natively through the Anthropic provider.
    • Allows user_prompt to be supplied in Human-in-the-Loop (HITL) interactions.
    • Adds Gemini 3 Pro support to OpenRouterModel.
    • Ensures the openrouter_reasoning model setting is correctly forwarded to the OpenRouter API.
  130. v1.22.0 Nov 22, 2025 · issue -268

    PydanticAI v1.22.0 adds OpenRouterModel, broadens FallbackModel error handling, and extends Anthropic caching support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.22.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.22.0
    └──▷ USE IT
    Chain multiple models so that any API-level failure (not just HTTP errors) automatically tries the next model.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.fallback import FallbackModel
    from pydantic_ai.models.openai import OpenAIModel
    from pydantic_ai.models.anthropic import AnthropicModel
    
    model = FallbackModel(OpenAIModel('gpt-4o'), AnthropicModel('claude-3-5-sonnet-latest'))
    agent = Agent(model)
    result = agent.run_sync('Analyze this log file for anomalies.')
    print(result.output)
    • Adds OpenRouterModel as an OpenAIChatModel subclass with additional feature support for the OpenRouter API.
    • Expands FallbackModel to fall back on all model API errors, not only HTTP 4xx+ status responses.
    • Adds document to the allowed cacheable_types for Anthropic, enabling document caching.
  131. v1.21.0 Nov 21, 2025 · issue -269

    PydanticAI v1.21.0 adds MCP client resource support, server instructions exposure, and a BinaryContent path loader.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.21.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.21.0
    └──▷ USE IT
    Load a local image or binary file into an agent message without manually reading bytes.
    python
    from pydantic_ai.messages import BinaryContent
    
    content = BinaryContent.from_path('screenshot.png')
    Inspect the instructions a connected MCP server advertises, useful for debugging server configuration.
    python
    from pydantic_ai.mcp import MCPServerSSE
    
    server = MCPServerSSE(url='http://localhost:8080/sse')
    print(server.instructions)
    • Adds BinaryContent.from_path convenience method for loading binary content directly from a file path.
    • Exposes MCP server instructions via the MCPServer.instructions property.
    • Adds MCP client Resources support, enabling agents to read resources from MCP servers.
    • Enforces that message history always starts with a user message.
    • Always strips Markdown fences from structured output, improving reliability of parsed responses.
    └──▷ BREAKING ON UPGRADE
    • !Message history that does not start with a user message is now rejected — any existing code passing histories beginning with a non-user message will break.
  132. v1.20.0 Nov 19, 2025 · issue -271

    PydanticAI v1.20.0 adds Gemini 3 Pro support, metadata fields on model messages, TTL for Anthropic cache, and enhanced Gemini JSON Schema features.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.20.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.20.0
    └──▷ USE IT
    Attach trace or correlation metadata to a model request and inspect it on the response — useful for logging and auditing multi-step agent runs.
    python
    from pydantic_ai.messages import ModelRequest
    
    # metadata flows through the request/response cycle
    request = ModelRequest(parts=[...], metadata={'trace_id': 'abc-123', 'env': 'prod'})
    print(request.metadata)  # {'trace_id': 'abc-123', 'env': 'prod'}
    • Adds ModelRequest.metadata and ModelResponse.metadata fields for attaching arbitrary metadata to model messages.
    • Adds ttl field to CachePoint and Anthropic caching model settings, enabling control over cache entry lifetime.
    • Adds support for Gemini 3 Pro via GoogleModel.
    • Supports Gemini enhanced JSON Schema features when using GoogleModel.
    • Makes RunContext.usage available in Temporal workflow contexts.
    +2 moreshow less
    • Wraps google.genai.errors.APIError in ModelHTTPError so GoogleModel errors are handled correctly by FallbackModel.
    • Extracts Google model usage metrics using genai-prices for more accurate token cost tracking.
  133. v1.19.0 Nov 18, 2025 · issue -272

    PydanticAI v1.19.0 adds metadata passthrough to deferred tool exceptions and Anthropic token-counting support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.19.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.19.0
    └──▷ USE IT
    Attach routing or audit metadata to a deferred tool call so downstream handlers know what to do with it.
    python
    from pydantic_ai.exceptions import CallDeferred
    
    raise CallDeferred(metadata={'queue': 'human-review', 'priority': 'high'})
    • Adds count_tokens method to AnthropicModel for explicit token counting.
    • Adds support for UsageLimits.count_tokens_before_request with AnthropicModel, enabling pre-flight token budget checks.
    • Allows metadata to be passed to CallDeferred and ApprovalRequired exceptions, propagating it onto DeferredToolRequests.
  134. v1.18.0 Nov 14, 2025 · issue -276

    PydanticAI v1.18.0 adds Anthropic prompt caching support and recognizes GPT-5.1 as a known model name.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.18.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.18.0
    • Adds Anthropic prompt caching support.
    • Adds gpt-5.1 to the list of known OpenAI model names; bumps openai dependency to v2.8.0 (v1 still supported).
    • Bumps temporalio to v1.19.0 and adopts SimplePlugin.
  135. v1.17.0 Nov 14, 2025 · issue -276

    PydanticAI v1.17.0 adds Temporal support for FastMCPToolset and environment variable expansion in mcp.json

    └──▷ GET THIS VERSION
    $ git clone --branch v1.17.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.17.0
    └──▷ USE IT
    Inject secrets or environment-specific values into your MCP server config without hardcoding them in mcp.json.
    json
    {
      "mcpServers": {
        "my-server": {
          "command": "python",
          "args": ["server.py"],
          "env": {
            "API_KEY": "${MY_API_KEY}"
          }
        }
      }
    }
    • Supports environment variable expansion inside mcp.json when loading servers via load_mcp_servers().
    • Enables FastMCPToolset to work with Temporal for durable, workflow-based MCP tool execution.
  136. v1.15.0 Nov 13, 2025 · issue -277

    PydanticAI v1.15.0 adds run IDs across run/message classes and token-counting support for BedrockConverseModel.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.15.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.15.0
    └──▷ USE IT
    Enforce a pre-request token budget on a Bedrock-backed agent — now possible because BedrockConverseModel supports count_tokens.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.bedrock import BedrockConverseModel
    from pydantic_ai.usage import UsageLimits
    
    model = BedrockConverseModel('anthropic.claude-3-5-sonnet-20241022-v2:0')
    agent = Agent(model)
    
    result = await agent.run(
        'Summarise this document',
        usage_limits=UsageLimits(request_tokens_limit=8000, count_tokens_before_request=True),
    )
    Correlate log entries or trace spans from a single agent run using the new run_id available on the result.
    python
    result = await agent.run('What is the capital of France?')
    print(result.run_id)  # e.g. 'a3f1c2d4-...'
    # Use result.run_id to filter logs or link all messages from this run
    • Adds BedrockConverseModel.count_tokens method, enabling UsageLimits.count_tokens_before_request to work with Bedrock-backed agents.
    • Adds a unique run_id field to run, run result, and message (request and response) classes for correlating events across a single agent run.
    • Wraps BedrockConverseModel errors in ModelHTTPError, making Bedrock failures handled correctly when used inside a FallbackModel.
  137. v1.14.0 Nov 10, 2025 · issue -280

    PydanticAI v1.14.0 allows custom provider factories to be passed into infer_model.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.14.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.14.0
    • Supports passing a custom provider factory into infer_model, enabling user-defined model resolution logic.
  138. v1.13.0 Nov 10, 2025 · issue -280

    PydanticAI v1.13.0 adds AgentRun message accessors and new gateway config fields for API type, profile, and routing group.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.13.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.13.0
    └──▷ USE IT
    Inspect all messages from a completed agent run, including tool calls and responses, for logging or audit.
    python
    result = await agent.run('What is the capital of France?')
    all_msgs = result.all_messages()
    new_msgs = result.new_messages_json()
    Route gateway traffic to a specific profile and routing group when using the PydanticAI gateway integration.
    python
    from pydantic_ai.models.gateway import GatewayModel
    
    model = GatewayModel(
        model_name='gpt-4o',
        api_type='azure',
        profile='prod-profile',
        routing_group='eu-west',
    )
    • Adds AgentRun.all_messages(), AgentRun.new_messages(), AgentRun.all_messages_json(), and AgentRun.new_messages_json() methods to retrieve accumulated or incremental messages from an agent run.
    • Adds api_type support to the gateway integration, enabling selection of the backend API type via gateway config.
    • Adds profile and routing_group support to the gateway integration, enabling fine-grained routing control.
    • Expands known model lists for Cerebras and Heroku providers.
  139. v1.11.1 Nov 6, 2025 · issue -284

    PydanticAI v1.11.1 adds FallbackModel support for Native output mode and ModelProfile.default_structured_output_mode

    └──▷ GET THIS VERSION
    $ git clone --branch v1.11.1 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.11.1
    • Adds ModelProfile.default_structured_output_mode support to FallbackModel, enabling native output mode control when falling back across models.
  140. v1.11.0 Nov 5, 2025 · issue -285

    PydanticAI v1.11.0 adds runtime instructions to agent.run() and partial_output access in output validators.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.11.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.11.0
    └──▷ USE IT
    Inject context-specific instructions at invocation time without creating a new agent — useful for per-request system guidance.
    python
    result = await agent.run(
        'Summarize this document',
        instructions='Always respond in formal English and limit output to 3 sentences.'
    )
    Inspect the partially-constructed output inside an output validator to apply conditional validation logic before the full object is finalised.
    python
    from pydantic_ai import RunContext
    
    @agent.output_validator
    async def check_output(ctx: RunContext, value: MyOutput) -> MyOutput:
        if ctx.partial_output is not None:
            # inspect intermediate state before full validation
            print('Partial so far:', ctx.partial_output)
        return value
    • Adds instructions parameter to agent.run(), allowing additional instructions to be injected at call time without reconfiguring the agent.
    • Adds partial_output field to RunContext supplied to output validators, exposing the partially-constructed output during validation.
  141. v1.10.0 Nov 4, 2025 · issue -286

    PydanticAI v1.10.0 adds synchronous streaming via Agent.run_stream_sync, application/msword file detection, and OpenAIResponsesModel.base_url.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.10.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.10.0
    └──▷ USE IT
    Run a streaming agent response synchronously — useful in scripts or frameworks where an event loop is unavailable.
    python
    with agent.run_stream_sync('Summarise this document') as result:
        for text in result.stream_text():
            print(text, end='', flush=True)
    • Adds Agent.run_stream_sync method and synchronous convenience methods on StreamedRunResult for consuming streamed agent runs without an async runtime.
    • Implements OpenAIResponsesModel.base_url property, exposing the configured base URL on the responses model.
    • Adds support for detecting and handling application/msword files as agent inputs.
  142. v1.9.1 Oct 31, 2025 · issue -290

    PydanticAI v1.9.1 adds AsyncAnthropicVertex support and makes AG-UI frontend state readable from on_complete handlers.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.9.1 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.9.1
    • Supports AsyncAnthropicVertex as the value for AnthropicProvider.anthropic_client, enabling async Anthropic Vertex AI usage.
    • Sets AG-UI frontend state directly on the provided deps object so it can be read from the on_complete handler.
  143. v1.9.0 Oct 29, 2025 · issue -292

    PydanticAI v1.9.0 adds support for the Vercel AI Data Stream Protocol.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.9.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.9.0
    • Supports the Vercel AI Data Stream Protocol, enabling PydanticAI agents to stream responses in a format compatible with Vercel AI SDK consumers.
  144. v1.8.0 Oct 29, 2025 · issue -292

    PydanticAI v1.8.0 adds experiment metadata support and honors openai_supports_tool_choice_required in OpenAI Responses models.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.8.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.8.0
    • Adds openai_supports_tool_choice_required model profile setting support in OpenAIResponsesModel, enabling correct tool-choice behavior for OpenAI-compatible endpoints that do or don't support required tool choice.
    • Adds experiment metadata support via the new experiment metadata API.
  145. v1.7.0 Oct 28, 2025 · issue -293

    PydanticAI v1.7.0 adds OutlinesModel for running local LLMs via Transformers, Llama.cpp, MLXLM, SGLang, and vLLM

    └──▷ GET THIS VERSION
    $ git clone --branch v1.7.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.7.0
    └──▷ USE IT
    Run a structured-output agent against a local model without any cloud API keys, using the Transformers backend via Outlines.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.outlines import OutlinesModel
    
    model = OutlinesModel('transformers', model_name='mistralai/Mistral-7B-v0.1')
    agent = Agent(model)
    result = agent.run_sync('Summarize this CVE advisory: ...')
    print(result.data)
    • Adds OutlinesModel class to run local models through the Outlines library, supporting Transformers, Llama.cpp, MLXLM, SGLang, and vLLM backends.
  146. v1.6.0 Oct 24, 2025 · issue -297

    PydanticAI v1.6.0 adds FastMCPToolset and a vLLM Responses API compatibility flag for OpenAI model profiles.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.6.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.6.0
    └──▷ USE IT
    Enable vLLM Responses API compatibility when using an OpenAI model profile that requires function call status to be set to none.
    python
    from pydantic_ai.models.openai import OpenAIModelProfile
    
    profile = OpenAIModelProfile(openai_responses_requires_function_call_status_none=True)
    • Adds OpenAIModelProfile.openai_responses_requires_function_call_status_none flag to enable compatibility with vLLM's Responses API.
    • Adds FastMCPToolset for integrating FastMCP tools into PydanticAI agents.
    • Auto-generated output tool names are now sanitized to support generic types.
  147. v1.5.0 Oct 24, 2025 · issue -297

    PydanticAI v1.5.0 introduces a beta graph API and improves OTel span naming for non-default backends.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.5.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.5.0
    • Introduces a new graph API in beta for building agent execution graphs.
    • Pre-formats run graph and node span names for compatibility with non-Logfire OTel backends.
  148. v1.4.0 Oct 24, 2025 · issue -297

    PydanticAI v1.4.0 adds native MCP server support for OpenAI and Anthropic via the built-in MCPServerTool.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.4.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.4.0
    └──▷ USE IT
    Use MCPServerTool to connect an OpenAI or Anthropic agent to a native MCP server without writing a custom tool wrapper.
    python
    from pydantic_ai.tools import MCPServerTool
    • Adds MCPServerTool built-in tool to support OpenAI and Anthropic native MCP (Model Context Protocol) server integration.
    • Raises a clear error when a Google content filter produces an empty response, making content-filter failures visible instead of silent.
  149. v1.3.0 Oct 22, 2025 · issue -299

    PydanticAI v1.3.0 adds AWS Bedrock gateway support, OVHcloud provider, IncompleteToolCall errors, and expanded OTel attributes.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.3.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.3.0
    └──▷ USE IT
    Catch truncated tool calls gracefully in CI pipelines where token budgets are tight.
    python
    from pydantic_ai.exceptions import IncompleteToolCall
    
    try:
        result = await agent.run(prompt)
    except IncompleteToolCall as e:
        print(f'Tool call was cut off by token limit: {e}')
    Connect to Vertex AI using an API key instead of application-default credentials.
    python
    from pydantic_ai.providers.google import GoogleProvider
    
    provider = GoogleProvider(api_key='YOUR_VERTEX_API_KEY')
    • Raises IncompleteToolCall exception when a token limit is reached mid-generation of a tool call, giving callers a typed signal to handle truncated tool invocations.
    • Adds http_client option to GoogleProvider and adds api_key support for Vertex AI; uses PydanticAI's cached httpx client by default.
    • Uses gateway/<upstream_provider>: as the provider name prefix for Gateway model references.
    • Adds AWS Bedrock support to the PydanticAI Gateway.
    • Adds OVHcloud AI Endpoints as a new provider.
    +4 moreshow less
    • Makes AbstractBuiltinTool serializable and compatible with durable execution workflows.
    • Includes eval report averages in OpenTelemetry span attributes.
    • Includes all usage fields (beyond token counts) in OpenTelemetry span attributes.
    • Ensures toolset spans (e.g. MCP sampling) are nested under the agent run span in traces.
  150. v1.2.0 Oct 20, 2025 · issue -301

    PydanticAI v1.2.0 adds Claude Haiku 4.5 support and genai-prices-based OpenAI usage extraction.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.2.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.2.0
    • Adds Claude Haiku 4.5 as a supported model.
    • Extracts OpenAI usage data via the genai-prices library for more accurate token cost reporting.
    • Includes final_result as an agent span attribute after streaming completes, improving observability in traces.
  151. v1.1.0 Oct 15, 2025 · issue -306

    PydanticAI v1.1.0 adds Prefect durable execution support and a description argument for tool decorators.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.1.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.1.0
    └──▷ USE IT
    Document a tool's purpose inline when the function's docstring is absent or insufficient.
    python
    @agent.tool(description='Fetches the current weather for a given city from the weather API')
    def get_weather(ctx, city: str) -> str:
        ...
    • Adds description argument to tool function decorators, allowing inline documentation of tools without relying solely on docstrings.
    • Adds durable execution support with Prefect, enabling fault-tolerant, resumable agent runs orchestrated via Prefect workflows.
  152. v1.0.18 Oct 13, 2025 · issue -308

    PydanticAI v1.0.18 adds Nebius AI Studio provider, EvaluationReport.render(), and ToolCallPart.id for OpenAI Responses.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.18 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.18
    └──▷ USE IT
    Render a human-readable evaluation report after running evals against your agent.
    python
    report = EvaluationReport(...)
    print(report.render())
    • Adds ToolCallPart.id field to carry tool-call identifiers from the OpenAI Responses API.
    • Adds render method to the EvaluationReport class for displaying evaluation results.
    • Adds Nebius AI Studio as a supported model provider.
    • Adds anyio and httpcore to Temporal passthrough modules, enabling those libraries to work correctly in Temporal workflows.
  153. v1.0.17 Oct 9, 2025 · issue -312

    PydanticAI v1.0.17 lets you pass builtin_tools at agent run time instead of only at agent definition time.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.17 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.17
    • Allows builtin_tools to be specified at agent run time, enabling per-run control over which built-in tools are available without redefining the agent.
  154. v1.0.16 Oct 8, 2025 · issue -313

    PydanticAI v1.0.16 adds datetime.time/timedelta XML formatting, contextual agent name overrides, and FileUrl force-download support.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.16 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.16
    • Respects FileUrl.force_download flag in OpenAI Chat and Responses model integrations.
    • Supports datetime.time and timedelta types in format_as_xml, enabling richer XML serialization of time-based fields.
    • Allows agent name to be overridden contextually at runtime, without changing the agent's definition.
    • Accepts Sequence[ModelMessage] instead of list for method argument types, broadening compatibility with any sequence type.
    • Validates FileUrl and BinaryContent objects without an identifier as valid inputs.
  155. v1.0.15 Oct 3, 2025 · issue -317

    PydanticAI v1.0.15 adds image generation support, streaming events API, and new ModelResponse convenience methods.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.15 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.15
    └──▷ USE IT
    Stream agent events without manually wiring up an event_stream_handler — useful for real-time UIs or logging pipelines.
    python
    async for event in agent.run_stream_events('Summarize this document', deps=deps):
        print(event)
    Extract just the text from the latest model response after a run, without manually iterating over message parts.
    python
    result = await agent.run('What is 2 + 2?')
    print(result.response.text)
    • Adds AgentRunResult.response convenience method to retrieve the latest model response from a completed agent run.
    • Adds ModelResponse.text, ModelResponse.thinking, ModelResponse.files, ModelResponse.images, ModelResponse.tool_calls, and ModelResponse.builtin_tool_calls convenience methods for accessing parts of a model response.
    • Adds Agent.run_stream_events() convenience method as a shorthand wrapper around run(event_stream_handler=...).
    • Supports image generation and image output with Google and OpenAI providers.
    • Adds content (e.g. files) returned by a tool to FunctionToolResultEvent, making tool output accessible in event streams.
    +3 moreshow less
    • Sets MCPServer id and tool_prefix attributes automatically in load_mcp_servers.
    • Adds gemini-2.5-flash and gemini-2.5-flash-lite model names and aliases for the Google Gemini provider.
    • Supports enums in format_as_xml for structured XML formatting of enum values.
  156. v1.0.13 Oct 2, 2025 · issue -318

    PydanticAI v1.0.13 adds contextual agent instruction overrides, exposes MCPServer.server_info, and upgrades OTel instrumentation.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.13 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.13
    └──▷ USE IT
    Inspect MCP server metadata after connecting — useful for logging or validating server capabilities before dispatching tool calls.
    python
    info = await mcp_server.server_info
    print(info)
    • Exposes server_info on MCPServer instances, giving access to MCP server metadata at runtime.
    • Supports contextually overriding agent instructions at runtime, enabling dynamic per-request instruction customization.
    • Upgrades OpenTelemetry instrumentation to version 3 with updated eval attributes for improved observability.
  157. v1.0.12 Oct 1, 2025 · issue -319

    PydanticAI v1.0.12 adds Anthropic built-in memory tool support, OpenAI document URL/binary content for text/JSON/XML/YAML, and evals cost metrics.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.12 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.12
    • Adds retry args to pydantic_evals.Dataset.evaluate_sync for configurable retry behavior in evaluation runs.
    • Adds cost metric to pydantic-evals output, giving visibility into token spend per evaluation.
    • Supports Anthropic's built-in memory tool, enabling agents to persist and recall information across turns via the provider-native mechanism.
    • Supports text, JSON, XML, and YAML DocumentUrl and BinaryContent on OpenAI, expanding the range of document types agents can process.
    • Prefers structuredContent in MCP tool results when present, enabling richer structured data from MCP tool calls.
    +4 moreshow less
    • Exposes .messages and .toolsets types in the top-level pydantic_ai namespace to improve IDE auto-import discovery.
    • Broadens the type of common_tools to work with agents of any deps type, removing a previous type-narrowing restriction.
    • Handles Gemini responses with more than one candidate without raising an error.
    • Handles Ollama responses that omit finish_reason and adds documentation for Ollama Cloud.
  158. v1.0.11 Sep 30, 2025 · issue -320

    PydanticAI v1.0.11 adds OpenAI image detail via vendor_metadata, operation.cost metrics, and makes OutputObjectDefinition public.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.11 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.11
    └──▷ USE IT
    Pass OpenAI image detail level when sending an image to a vision model, to control token usage vs. resolution trade-off.
    python
    from pydantic_ai.models.openai import ImageUrl
    
    image = ImageUrl(
        url='https://example.com/diagram.png',
        vendor_metadata={'detail': 'high'}
    )
    Import and use OutputObjectDefinition directly to build structured output schemas programmatically.
    python
    from pydantic_ai.output import OutputObjectDefinition
    • Supports OpenAI image detail level on ImageUrl and BinaryContent via the vendor_metadata parameter, enabling fine-grained vision API control.
    • Adds operation.cost metric to instrumented models, exposing per-call cost data through OpenTelemetry instrumentation.
    • Makes OutputObjectDefinition publicly importable from pydantic_ai.output, enabling programmatic construction of output schemas.
    • Supports callable classes (not just functions) as history processors, broadening the composition options for message-history pipelines.
    • Adds claude-sonnet-4-5 to the list of known model name strings recognized by the library.
  159. v1.0.10 Sep 20, 2025 · issue -330

    PydanticAI v1.0.10 adds model class names as XML tags and field-level metadata options to format_as_xml.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.10 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.10
    • Adds option to include field titles and descriptions as attributes in format_as_xml, and uses model class names as XML tags by default.
  160. v1.0.9 Sep 18, 2025 · issue -332

    PydanticAI v1.0.9 adds RunContext retry introspection and streams built-in tool calls from OpenAI, Google, and Anthropic.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.9 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.9
    └──▷ USE IT
    Gate expensive fallback logic so it only runs on the last allowed attempt inside a tool.
    python
    from pydantic_ai import RunContext
    
    async def my_tool(ctx: RunContext[None], query: str) -> str:
        if ctx.last_attempt:
            return f'Final attempt reached (max={ctx.max_retries}), returning cached result'
        result = call_external_api(query)
        return result
    • Adds RunContext.max_retries and RunContext.last_attempt so tool functions can inspect retry limits and detect whether the current invocation is the final attempt.
    • Streams built-in tool calls from OpenAI, Google, and Anthropic and returns them on the next request, enabling support for OpenAI reasoning models.
    • Includes built-in tool calls and their results in OpenTelemetry (OTel) messages for full observability of tool interactions.
  161. v1.0.8 Sep 17, 2025 · issue -333

    PydanticAI v1.0.8 lets tools emit AG-UI events independently from the result returned to the model.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.8 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.8
    • Tools can now return AG-UI events separately from the result sent to the model, enabling richer streaming side-effects without coupling event emission to the model's input.
  162. v1.0.7 Sep 15, 2025 · issue -335

    PydanticAI v1.0.7 adds MCP metadata filtering, FunctionToolset defaults, and improved RunContext prompt access.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.7 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.7
    └──▷ USE IT
    Set toolset-wide defaults so every tool in the FunctionToolset inherits the same strict mode and approval requirement without per-tool decoration.
    python
    from pydantic_ai.toolsets import FunctionToolset
    
    toolset = FunctionToolset(
        strict=True,
        sequential=False,
        requires_approval=True,
        metadata={"source": "internal"}
    )
    Filter or inspect MCP tools at runtime by reading annotations from ToolDefinition.metadata before passing them to the agent.
    python
    from pydantic_ai.tools import ToolDefinition
    
    def only_safe_tools(tool_def: ToolDefinition) -> bool:
        meta = tool_def.metadata or {}
        return not meta.get("destructive", False)
    • Adds ToolDefinition.metadata field to carry MCP metadata and annotations, enabling filtering of MCP tools by metadata.
    • Adds support for default values for strict, sequential, requires_approval, and metadata parameters on FunctionToolset, reducing per-tool boilerplate.
    • When a run starts with a message history ending in a ModelRequest, its content is now available in RunContext.prompt.
    • Removes the requirement to install mcp or logfire extras when using Temporal or DBOS integrations.
    • Combines consecutive AG-UI user and assistant messages into a single model request/response.
  163. v1.0.6 Sep 12, 2025 · issue -338

    PydanticAI v1.0.6 adds previous_response_id support for the Responses API and file-based MCP server loading.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.6 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.6
    • Adds previous_response_id parameter support for the OpenAI Responses API, enabling stateful multi-turn conversations backed by server-side response chaining.
    • Enables MCP servers to be loaded from a file, allowing declarative configuration of MCP server definitions outside of Python code.
  164. v1.0.4 Sep 11, 2025 · issue -339

    PydanticAI v1.0.4 adds a Pydantic AI Gateway provider for routing and managing LLM calls.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.4 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.4
    • Adds a Pydantic AI Gateway provider, enabling use of the Pydantic AI Gateway as an LLM backend.
  165. v1.0.3 Sep 10, 2025 · issue -340

    PydanticAI v1.0.3 adds sequential tool call context manager, AG-UI callbacks, and Google model seed support

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.3 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.3
    └──▷ USE IT
    Force an agent to execute tools one at a time — useful when tools have side effects that must not run concurrently.
    python
    with agent.sequential_tool_calls():
        result = await agent.run('Book a flight then send a confirmation email')
    Inspect the full AgentRunResult after an AG-UI run completes, e.g. to log structured output or trigger downstream actions.
    python
    async def handle_complete(result: AgentRunResult) -> None:
        print(result.output)
    
    await agent.run_as_agui(prompt, on_complete=handle_complete)
    Pin a Google model to a fixed random seed so repeated runs return deterministic results during testing.
    python
    from pydantic_ai.settings import ModelSettings
    
    result = await agent.run('Summarize this doc', model_settings=ModelSettings(seed=42))
    • Adds agent.sequential_tool_calls() context manager to enforce sequential (non-parallel) tool execution within an agent run.
    • Adds on_complete callback to AG-UI functions, providing access to AgentRunResult when a run finishes.
    • Supports ModelSettings.seed in GoogleModel for reproducible outputs.
    • Supports NativeOutput with FunctionModel, enabling native structured output in function-backed models.
    • Sends AG-UI thinking start and end events, surfacing model reasoning steps to AG-UI consumers.
    +3 moreshow less
    • Includes thinking parts in subsequent model requests to improve performance and cache hit rates.
    • Raises a clear error when WebSearchTool is used with OpenAIChatModel and an unsupported model, rather than failing silently.
    • Supports models that return output tool args as {"response": "<JSON string>"}, broadening compatibility with non-standard model response formats.
  166. v1.0.2 Sep 9, 2025 · issue -341

    PydanticAI v1.0.2 adds DBOS durable execution, sequential tool calling, and Google cached content support

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.2 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.2
    └──▷ USE IT
    Use Google's cached content in a model call to avoid re-processing large, repeated context on every request.
    python
    from pydantic_ai.models.google import GoogleModelSettings
    
    settings = GoogleModelSettings(
        google_cached_content="cachedContents/abc123"
    )
    result = await agent.run("Summarize the document.", model_settings=settings)
    • Adds GoogleModelSettings.google_cached_content field to pass cached_content when calling Google models, enabling prompt caching.
    • Adds ModelResponse.finish_reason attribute and populates provider_response_id during streaming responses.
    • Adds support for gen_ai.response.id in OpenTelemetry instrumentation spans.
    • Adds support for durable execution with DBOS, enabling fault-tolerant, resumable agent workflows.
    • Adds support for sequential tool calling, allowing agents to invoke tools one at a time in order rather than in parallel.
  167. v1.0.0 Sep 5, 2025 · issue -345

    PydanticAI v1.0.0 adds human-in-the-loop tool approval, LiteLLM provider, tool-call usage limits, and NativeOutput for Groq.

    └──▷ GET THIS VERSION
    $ git clone --branch v1.0.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v1.0.0
    └──▷ USE IT
    Cap the number of tool calls an agent can make in a single run to prevent runaway tool loops.
    python
    from pydantic_ai import Agent
    from pydantic_ai.settings import UsageLimits
    
    agent = Agent('openai:gpt-4o')
    result = await agent.run(
        'Research and summarize the latest CVEs for OpenSSL',
        usage_limits=UsageLimits(tool_calls_limit=5)
    )
    print(result.usage().tool_calls)  # inspect actual tool calls made
    Control how tool schemas are generated from docstrings — useful when enforcing that all parameters must be documented before deployment.
    python
    from pydantic_ai.toolsets import FunctionToolset
    
    toolset = FunctionToolset(
        docstring_format='google',
        require_parameter_descriptions=True
    )
    • Adds tool_calls_limit to UsageLimits and tool_calls to RunUsage to cap and track tool-call counts per run.
    • Adds docstring_format, require_parameter_descriptions, and schema_generator parameters to FunctionToolset for fine-grained tool schema control.
    • Adds operation.cost span attribute to model request spans; renames ModelResponse.price() to ModelResponse.cost().
    • Adds identifier field to FileUrl and its subclasses.
    • Adds human-in-the-loop tool call approval support, enabling agents to pause and await human confirmation before executing tools.
    +5 moreshow less
    • Adds a LiteLLM provider for OpenAI-API-compatible models.
    • Supports NativeOutput with Groq models.
    • Bundles logfire with the pydantic-ai package so tracing is available without a separate install.
    • Allows most types used in documentation examples to be imported directly from pydantic_ai.
    • Defaults InstrumentationSettings version to 2.
    └──▷ BREAKING ON UPGRADE
    • !Python 3.9 is no longer supported; the minimum supported version is now Python 3.10.
    • !ModelResponse.price() is renamed to ModelResponse.cost(); call sites using .price() will break.
    • !OpenAIModelProfile.openai_supports_sampling_settings is deprecated.
    • !mcp-run-python has been moved to its own repository and is no longer part of this package.
  168. v0.8.1 Aug 29, 2025 · issue -352

    PydanticAI v0.8.1 adds system-instructions tracing to agent run spans and renames key streaming and response methods.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.8.1 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.8.1
    • Adds gen_ai.system_instructions attribute to agent run spans, exposing system prompt content in OpenTelemetry traces.
    • Renames StreamedRunResult methods to be consistent with AgentStream (see breaking changes).
    • Renames ModelResponse.provider_request_id to provider_response_id (see breaking changes).
    └──▷ BREAKING ON UPGRADE
    • !StreamedRunResult methods are renamed to match AgentStream naming conventions — callers using the old method names will break on upgrade.
    • !ModelResponse.provider_request_id is renamed to provider_response_id — any code referencing provider_request_id will break on upgrade.
    • !Specifying a model name without a provider prefix is deprecated, as is the vertexai provider name — configurations using bare model names or vertexai will need to be updated.
  169. v0.8.0 Aug 26, 2025 · issue -355

    PydanticAI v0.8.0 adds elicitation callbacks for MCP servers, message history in CLI agents, and a richer AgentStreamEvent union type.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.8.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.8.0
    └──▷ USE IT
    Seed a CLI agent session with prior message history so returning users resume context rather than starting fresh.
    python
    agent.to_cli(message_history=prior_messages)
    • Adds message_history parameter to agent.to_cli() to seed CLI sessions with prior conversation context.
    • Adds elicitation callback support to MCP servers, enabling agents to request additional input from users during tool execution.
    • Makes AgentStreamEvent a union of ModelResponseStreamEvent and HandleResponseEvent, expanding the event types available when streaming agent responses.
  170. v0.7.6 Aug 26, 2025 · issue -355

    PydanticAI v0.7.6 adds a Cerebras provider and renames the OpenAI model class.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.7.6 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.7.6
    • Adds CerebrasProvider (Cerebras provider integration) for running agents against Cerebras-hosted models.
    • Replaces all_messages_events with pydantic_ai.all_messages span/event name under InstrumentationSettings(version=2).
    • Deprecates OpenAIModel in favor of the new OpenAIChatModel class.
    └──▷ BREAKING ON UPGRADE
    • !The tenacity retry implementation has changed behavior — existing retry logic built on the prior AsyncTenacityTransport semantics may behave differently on upgrade.
  171. v0.7.5 Aug 25, 2025 · issue -356

    PydanticAI v0.7.5 adds cost pricing on ModelResponse, span/trace IDs on EvaluationReport, and updated OpenTelemetry GenAI conventions.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.7.5 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.7.5
    └──▷ USE IT
    Inspect the monetary cost of a model response after an agent run, useful for budget tracking or logging.
    python
    result = await agent.run('Summarise this document')
    print(result.new_messages()[-1].price())
    • Adds price() method to ModelResponse to retrieve cost information for a model response.
    • Adds span_id and trace_id fields to EvaluationReport for linking evaluations to distributed traces.
    • Updates OpenTelemetry instrumentation to use the new GenAI chat span attribute conventions.
    • Includes thoughts tokens in output_tokens accounting for Google models.
    • Allows proper typing on AnthropicProvider when using the Bedrock backend.
    └──▷ BREAKING ON UPGRADE
    • !OpenTelemetry span attributes for GenAI chat now follow the new GenAI conventions — any dashboards, alerts, or attribute-based queries built on the old attribute names will need to be updated.
  172. v0.7.4 Aug 20, 2025 · issue -361

    PydanticAI v0.7.4 adds takes_ctx to Tool.from_schema and supports Google's url_context built-in tool.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.7.4 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.7.4
    └──▷ USE IT
    Create a schema-derived tool that receives the agent context, enabling context-aware logic inside the tool handler.
    python
    tool = Tool.from_schema(schema=my_schema, takes_ctx=True)
    Enable Google's URL context built-in tool so the agent can fetch and reason over live web content during a run.
    python
    from pydantic_ai.models.google import UrlContextTool
    
    agent = Agent(model='google-gla:gemini-2.0-flash', tools=[UrlContextTool()])
    • Adds takes_ctx argument to Tool.from_schema, letting callers control whether the generated tool receives the agent context.
    • Supports Google's url_context built-in tool via the new UrlContextTool class, now exported in __all__.
  173. v0.7.3 Aug 19, 2025 · issue -362

    PydanticAI v0.7.3 adds a CLI clipboard command, lets FallbackModel accept string names, and splits Usage into RequestUsage and RunUsage.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.7.3 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.7.3
    └──▷ USE IT
    Use a string model name directly in FallbackModel instead of constructing a model object.
    python
    from pydantic_ai.models.fallback import FallbackModel
    
    model = FallbackModel('openai:gpt-4o', 'anthropic:claude-3-5-sonnet-latest')
    • Adds /cp command to the CLI to copy the last response to the clipboard.
    • FallbackModel now accepts plain string model names in addition to model objects.
    • Moves system_prompt_role from OpenAIModel to OpenAIModelProfile, making it configurable at the profile level.
    • Introduces RequestUsage and RunUsage as replacements for the unified Usage class, providing finer-grained usage tracking.
    └──▷ BREAKING ON UPGRADE
    • !Usage is deprecated in favour of RequestUsage and RunUsage; code referencing Usage directly will need to migrate to the appropriate replacement class.
  174. v0.7.2 Aug 14, 2025 · issue -363

    PydanticAI v0.7.2 adds OllamaProvider, HuggingFace profile/settings, and max_uses for Anthropic WebSearchTool.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.7.2 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.7.2
    └──▷ USE IT
    Cap web searches to 3 per agent run when using Anthropic's built-in WebSearchTool to control cost and latency.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.anthropic import AnthropicModel
    from pydantic_ai.tools.anthropic import WebSearchTool
    
    agent = Agent(
        model=AnthropicModel('claude-3-5-sonnet-latest'),
        tools=[WebSearchTool(max_uses=3)],
    )
    result = agent.run_sync('What are the latest CVEs in OpenSSL?')
    print(result.output)
    • Adds OllamaProvider for connecting PydanticAI agents to locally hosted Ollama models.
    • Adds profile and settings parameters to HuggingfaceModel for finer control over HuggingFace inference.
    • Forwards max_uses parameter to Anthropic's WebSearchTool, allowing callers to cap the number of web searches per run.
    • Allows message history to end on a ModelResponse and automatically executes any pending tool calls, enabling richer conversation resumption.
    • Prompts the model to retry when it produces a response containing only thinking tokens (no text or tool calls), improving reliability with reasoning models.
    └──▷ BREAKING ON UPGRADE
    • !Removes the anthropic-beta default header previously set in AnthropicModel; integrations relying on that header being sent automatically will need to set it explicitly.
  175. v0.7.1 Aug 13, 2025 · issue -363

    PydanticAI v0.7.1 adds GPT-5 models, OpenAI verbosity support, pre-request token counting via Gemini, and a new model inference string.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.7.1 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.7.1
    └──▷ USE IT
    Select the OpenAI Responses API using the new inference string shorthand instead of importing a model class.
    python
    from pydantic_ai import Agent
    
    agent = Agent('openai-responses:gpt-4o')
    result = await agent.run('What is the capital of France?')
    print(result.output)
    • Adds UsageLimits.count_tokens_before_request to count tokens using Gemini's count_tokens API before a request is sent, enabling proactive limit enforcement.
    • Supports the "openai-responses" model inference string for selecting the OpenAI Responses API via string-based model configuration.
    • Adds support for the OpenAI verbosity parameter in the Responses API.
    • Adds new OpenAI GPT-5 models to the supported model list.
  176. v0.7.0 Aug 12, 2025 · issue -363

    PydanticAI v0.7.0 adds Temporal workflow support, dynamic toolsets, event stream handlers, and new agent abstractions.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.7.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.7.0
    └──▷ USE IT
    Tap into the live event stream of an agent run — useful for streaming intermediate tool-call and model-request events to a UI or logger.
    python
    async with agent.run_stream('Analyze logs', event_stream_handler=my_handler) as response:
        async for chunk in response.stream_text():
            print(chunk)
    • Adds event_stream_handler parameter to agent and run methods for subscribing to agent event streams.
    • Adds Agent.override(tools=...) to replace or inject tools into an existing agent at runtime.
    • Adds AbstractAgent and WrapperAgent base classes for building composable agent wrappers.
    • Enables running Agent inside a Temporal workflow by dispatching model requests, tool calls, and MCP as Temporal activities.
    • Supports dynamically building toolsets based on run context via the toolset API.
    +1 moreshow less
    • Adds a history processor API that replaces message history on each run, enabling custom context-window management.
  177. v0.6.2 Aug 7, 2025 · issue -363

    PydanticAI v0.6.2 adds builtin_tools parameter to the Agent class.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.6.2 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.6.2
    • Adds builtin_tools parameter to Agent, enabling control over which built-in tools are available to an agent.
  178. v0.6.1 Aug 7, 2025 · issue -363

    PydanticAI v0.6.1 adds automatic OpenAI strict mode, Bedrock thinking parts, AWS bearer token support, and new Heroku models.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.6.1 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.6.1
    • Supports AWS_BEARER_TOKEN_BEDROCK environment variable for authenticating with AWS Bedrock via bearer token.
    • Makes InlineDefsJsonSchemaTransformer part of the public API, allowing direct use in custom JSON schema transformations.
    • Automatically enables OpenAI strict mode for output types that are strict-compatible, removing the need for manual configuration.
    • Sends ThinkingParts back to Anthropic when accessed through AWS Bedrock, enabling extended thinking round-trips.
    • Adds new Heroku models to the supported model list.
  179. v0.6.0 Aug 6, 2025 · issue -363

    PydanticAI v0.6.0 adds a new Anthropic model and removes a wave of long-deprecated APIs.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.6.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.6.0
    • Adds a new Anthropic model (removes older deprecated Anthropic models in the same change).
    └──▷ BREAKING ON UPGRADE
    • !The next() method is removed from Graph.
    • !The data attribute is removed from FinalResult.
    • !The get_data and validate_structured_result methods are removed from StreamedRunResult.
    • !The format_as_xml module is removed entirely.
    • !The result_type parameter (and similar parameters) is removed from Agent.
    • !Four months of accumulated deprecation warnings are now hard removals — any code that relied on those deprecated APIs will break.
  180. v0.5.0 Aug 4, 2025 · issue -363

    PydanticAI v0.5.0 expands OpenAI strict JSON mode compatibility and adds default values to tool argument schemas.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.5.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.5.0
    • Enables more BaseModels to use OpenAI strict JSON mode by defaulting additionalProperties=False automatically.
    • Supports string format, pattern, and related constraints within OpenAI strict JSON mode.
    • Includes default values in the JSON schema generated for tool arguments.
    └──▷ BREAKING ON UPGRADE
    • !The EvaluationReport.print and EvaluationReport.console_table methods now require most arguments to be passed by keyword.
    • !The source field of EvaluationResult is now of type EvaluatorSpec instead of the actual Evaluator instance; existing code that accessed the live evaluator instance via source will break.
  181. v0.4.11 Aug 1, 2025 · issue -363

    PydanticAI v0.4.11 adds AG-UI convenience functions and custom thinking-tag support on model profiles.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.11 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.11
    • Supports custom thinking tags specified on the model profile, letting callers control how chain-of-thought tokens are surfaced per model.
    • Adds convenience functions to handle AG-UI requests with request-specific dependencies.
  182. v0.4.10 Jul 30, 2025 · issue -364

    PydanticAI v0.4.10 adds priority service_tier to OpenAI settings and HTTP Referer header support for Vercel AI Gateway.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.10 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.10
    └──▷ USE IT
    Route OpenAI requests through the priority service tier to reduce latency for time-sensitive workloads.
    python
    from pydantic_ai.models.openai import OpenAIModelSettings
    
    settings = OpenAIModelSettings(service_tier='priority')
    result = await agent.run('Summarize this incident report.', model_settings=settings)
    • Adds priority service_tier option to OpenAIModelSettings, respected by OpenAIResponsesModel, enabling OpenAI priority-tier routing from model configuration.
    • Adds HTTP Referer request header support to the Vercel AI Gateway provider.
  183. v0.4.8 Jul 28, 2025 · issue -364

    PydanticAI v0.4.8 adds tenacity retry integration and thinking-part tracing in OpenTelemetry model response events.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.8 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.8
    • Adds tenacity utilities and integration for improved retry handling in agent workflows.
    • Includes ThinkingPart in OpenTelemetry OTEL events emitted via ModelResponse, surfacing model reasoning in traces.
  184. v0.4.7 Jul 24, 2025 · issue -364

    PydanticAI v0.4.7 adds MoonshotAI, Vercel AI Gateway providers, Gemini Files API support, and MCP ResourceLink handling.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.7 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.7
    └──▷ USE IT
    Connect an MCP server using the renamed read_timeout parameter to avoid breaking on upgrade.
    python
    from pydantic_ai.mcp import MCPServer
    
    server = MCPServer(
        url='https://mcp.example.com/sse',
        read_timeout=30,
    )
    • Renames MCPServer parameter sse_read_timeout to read_timeout, which is now passed through to ClientSession.
    • Adds MoonshotAI provider with Kimi-K2 model support.
    • Adds Vercel AI Gateway provider.
    • Supports passing files uploaded to the Gemini Files API and setting a custom media type.
    • Parses <think> tags in streamed text as thinking parts (ThinkingPart).
    +1 moreshow less
    • Adds support for MCP ResourceLink returned from tools.
    └──▷ BREAKING ON UPGRADE
    • !The MCPServer parameter sse_read_timeout is renamed to read_timeout; any code passing sse_read_timeout by keyword will break on upgrade.
  185. v0.4.6 Jul 23, 2025 · issue -364

    PydanticAI v0.4.6 adds URL and binary PDF support for the Mistral provider.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.6 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.6
    • Adds URL and binary PDF input support for the Mistral provider, enabling document-based prompts via URL or raw binary PDF.
    • Speeds up the internal _estimate_string_tokens function, improving throughput for token-heavy workloads.
  186. v0.4.5 Jul 22, 2025 · issue -364

    PydanticAI v0.4.5 adds streamable HTTP transport support to mcp-run-python and changes format_as_xml defaults.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.5 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.5
    • Supports streamable HTTP transport in mcp-run-python, enabling streaming MCP server connections over HTTP.
    └──▷ BREAKING ON UPGRADE
    • !The default values for format_as_xml have changed; existing code relying on the previous defaults may produce different XML output after upgrading.
  187. v0.4.4 Jul 18, 2025 · issue -364

    PydanticAI v0.4.4 adds Toolsets, AG-UI protocol support, new OpenAI/Grok/Kimi models, and an identifier field on BinaryContent.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.4 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.4
    └──▷ USE IT
    Attach a binary file to an agent message and reference it later by a stable identifier.
    python
    from pydantic_ai.messages import BinaryContent
    
    image = BinaryContent(data=image_bytes, media_type='image/png', identifier='screenshot-001')
    result = await agent.run([image, 'Describe this image.'])
    • Adds identifier field to the BinaryContent class for tagging binary content objects.
    • Introduces Toolsets and Deferred Tools, enabling grouped and lazily-resolved tool registration on agents.
    • Supports the AG-UI protocol for frontend-agent communication.
    • Adds OpenAI models o1-pro, o3-pro, o3-deep-research, and computer-use as selectable models.
    • Adds grok-4 and kimi-k2 (via Groq) as selectable models.
    +1 moreshow less
    • Speeds up AgentRunResult._set_output_tool_return by ~18,798%, unlocking high-throughput agent run scenarios.
    └──▷ BREAKING ON UPGRADE
    • !Old Google models have been removed; any code referencing those model identifiers will break on upgrade.
  188. v0.4.3 Jul 16, 2025 · issue -364

    PydanticAI v0.4.3 adds Hugging Face provider support, output function tracing, and base64 encoding for tool returns.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.3 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.3
    • Adds base64 encoding support to tool_return_ta, enabling binary data to be returned from tools.
    • Adds output function tracing, allowing agent output functions to be captured in traces.
    • Adds Hugging Face as a new model provider.
    └──▷ BREAKING ON UPGRADE
    • !The duckduckgo-search package dependency is renamed to ddgs; any install or import referencing duckduckgo-search will break.
  189. v0.4.2 Jul 10, 2025 · issue -364

    PydanticAI v0.4.2 adds StructuredDict for custom JSON schema outputs, model settings on model classes, and DeepSeek reasoning_content streaming support.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.2 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.2
    • Adds StructuredDict class for defining structured outputs with a custom JSON schema, giving callers direct control over the schema shape returned by the model.
    • Allows model settings to be passed directly to model classes, enabling per-model configuration at instantiation time.
    • Supports DeepSeek reasoning_content field in streamed responses, surfacing chain-of-thought reasoning tokens from DeepSeek models during streaming.
    • Speeds up internal _ensure_decodeable function by 634%, unlocking higher-throughput decoding for workloads processing large volumes of model output.
    └──▷ BREAKING ON UPGRADE
    • !FastA2A has been dropped from the PydanticAI repository and is no longer available as part of the package.
  190. v0.4.1 Jul 10, 2025 · issue -364

    PydanticAI v0.4.1 adds sync task evaluation support and drops FastA2A as a transitive dependency.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.1 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.1
    • Adds support for evaluating synchronous tasks in PydanticAI's evals framework, expanding coverage beyond async-only workflows.
    └──▷ BREAKING ON UPGRADE
    • !FastA2A is no longer a PydanticAI dependency; projects that relied on it being pulled in transitively must now declare it as a direct dependency.
  191. v0.4.0 Jul 8, 2025 · issue -364

    PydanticAI v0.4.0 adds broader Gemini audio support and makes ToolDefinition.description optional.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.4.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.4.0
    • Makes ToolDefinition.description optional, removing the requirement to supply a description when defining tools.
    • Adds all Gemini-supported audio types to AudioUrl, expanding multimodal input coverage for Gemini models.
    • Retains default values in non-strict OpenAI schemas, preserving schema fidelity when targeting OpenAI backends.
    └──▷ BREAKING ON UPGRADE
    • !EvaluationReport and ReportCase are now generic dataclasses — any code that instantiates or type-annotates these without type parameters may require updates.
  192. v0.3.7 Jul 7, 2025 · issue -364

    PydanticAI v0.3.7 adds GitHub Models provider, ACI.dev Tools integration, sync streaming, and Google video analysis args.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.3.7 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.3.7
    • Adds model_request_stream_sync to the direct API, enabling synchronous streaming of model requests.
    • Adds GitHub Models as a new provider via the GitHub Models provider integration.
    • Adds support for Google-specific arguments for video analysis in the Google provider.
    • Implements ACI.dev Tools integration, providing a convenient way to use ACI.dev tools in PydanticAI.
    • AgentStream.stream_output (available inside agent.iter) now streams validated output data instead of raising validation errors mid-stream.
  193. v0.3.6 Jul 4, 2025 · issue -364

    PydanticAI v0.3.6 adds predicted outputs to OpenAIModelSettings and records tool responses in trace spans.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.3.6 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.3.6
    └──▷ USE IT
    Pass a predicted output to OpenAI to reduce latency when the likely response text is known in advance.
    python
    from pydantic_ai.models.openai import OpenAIModelSettings
    
    settings = OpenAIModelSettings(
        predicted_outputs={"type": "content", "content": "<your predicted text here>"}
    )
    result = await agent.run("Refactor this code", model_settings=settings)
    • Adds support for predicted_outputs in OpenAIModelSettings, enabling speculative/predicted output hints when calling OpenAI models.
    • Records tool response data in tool-run spans, enriching tracing and observability for agent tool calls.
    • Improves model communication by marking a RetryPromptPart not tied to a tool call as validation feedback rather than a user message, giving the model clearer signal on why a retry is occurring.
    • Switches agent overriding from a local attribute to contextvars, making agent context propagation safe across async/concurrent workloads.
  194. v0.3.5 Jun 30, 2025 · issue -365

    PydanticAI v0.3.5 lets tools return ToolReturn for richer model content and adds strict mode to NativeOutput.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.3.5 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.3.5
    • Supports strict mode in NativeOutput, enabling stricter schema validation for native model outputs.
    • Allows tools to return a ToolReturn object to pass additional content to the model or attach metadata that is not forwarded to the model.
    • Sets 'us-central1' as the default region on GoogleProvider, removing the need to configure it explicitly.
    • Moves ThinkingPart to precede TextPart in OpenAIResponsesModel, aligning reasoning output ordering.
    • Adds a progress bar during evaluation runs.
    └──▷ BREAKING ON UPGRADE
    • !The default region for GoogleProvider is now 'us-central1'; existing setups that relied on no default region being set may route requests differently after upgrading.
  195. v0.3.4 Jun 26, 2025 · issue -365

    PydanticAI v0.3.4 adds sensitive-content scrubbing to agent pipelines.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.3.4 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.3.4
    • Adds sensitive content scrubbing to redact or sanitize private data within agent interactions.
  196. v0.3.3 Jun 24, 2025 · issue -365

    PydanticAI v0.3.3 adds NativeOutput and PromptedOutput modes and captures more OpenAI-compatible usage fields.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.3.3 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.3.3
    • Adds NativeOutput and PromptedOutput output modes alongside the existing ToolOutput mode, giving agents more control over how structured results are produced.
    • Captures additional usage fields returned by OpenAI-compatible APIs, surfacing richer token and cost details in Usage objects.
    • Makes Edge hashable, enabling graph edges to be stored in sets and used as dict keys.
  197. v0.3.0 Jun 18, 2025 · issue -365

    PydanticAI v0.3.0 adds ThinkingPart support, parsing provider thinking blocks into a dedicated message part type.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.3.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.3.0
    • Adds ThinkingPart as a new message part type: provider-specific <think>...</think> blocks in text responses are now parsed and surfaced as structured ThinkingPart objects rather than raw text.
    └──▷ BREAKING ON UPGRADE
    • !ThinkingParts are not sent back to the provider in subsequent turns — existing agents that relied on thinking content being echoed back in the message history will no longer include it, reducing costs but changing round-trip behavior.
  198. v0.2.20 Jun 18, 2025 · issue -365

    PydanticAI v0.2.20 adds a process_tool_call hook for MCP servers and RunContext support in history processors.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.20 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.20
    • Adds process_tool_call hook to MCP servers, enabling interception and modification of tool arguments, metadata, and return values before and after MCP tool execution.
    • Adds RunContext support to history processors, giving them access to the full run context when processing conversation history.
    • Adds ModelSettings.timeout enforcement in GoogleModel, so timeout settings are now respected when calling Google models.
  199. v0.2.19 Jun 17, 2025 · issue -365

    PydanticAI v0.2.19 adds history_processors to Agent and surfaces events for unknown tool calls

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.19 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.19
    └──▷ USE IT
    Filter or redact sensitive messages from history before every model call, e.g. to strip PII in a compliance-sensitive pipeline.
    python
    from pydantic_ai import Agent
    from pydantic_ai.messages import ModelMessage
    
    def redact_secrets(messages: list[ModelMessage]) -> list[ModelMessage]:
        # drop any message whose text contains an API key pattern
        return [m for m in messages if 'sk-' not in str(m)]
    
    agent = Agent('openai:gpt-4o', history_processors=[redact_secrets])
    result = agent.run_sync('What did we discuss earlier?')
    • Adds history_processors parameter to Agent for programmatic pre-processing of message history before each model call.
    • Yields streaming events for unknown tool calls instead of silently dropping them, enabling downstream handling of unrecognised tool responses.
    • Makes infer_provider more flexible, accepting a broader range of inputs when resolving provider from a model string.
    • Ignores dynamic instructions that return an empty string, preventing blank system-prompt entries from being appended to the message list.
    └──▷ BREAKING ON UPGRADE
    • !Anthropic max_tokens is now set to 4096 by default; any agent relying on the previous default behaviour may produce truncated responses or incur different token usage.
  200. v0.2.18 Jun 13, 2025 · issue -365

    PydanticAI v0.2.18 adds MCP Streamable HTTP, OpenAI Responses API vendor ID, and reuses last message when no prompt is given.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.18 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.18
    • Exposes the OpenAI Responses API response ID as vendor_id on the model response object.
    • Adds MCP Streamable HTTP transport implementation.
    • Reuses the last request from message history automatically when no user prompt is provided, enabling continuation flows without re-supplying context.
    • Switches Gemini inference to use GoogleModel instead of GeminiModel.
  201. v0.2.17 Jun 12, 2025 · issue -365

    PydanticAI v0.2.17 adds token usage to InstrumentedModel, service_tier for OpenAI, custom httpx clients for MCP, and Gemini direct file URL support.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.17 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.17
    └──▷ USE IT
    Set a specific OpenAI service tier (e.g. 'flex' or 'auto') for cost or latency control in your agent's model settings.
    python
    from pydantic_ai.models.openai import OpenAIModelSettings
    
    settings = OpenAIModelSettings(service_tier='flex')
    • Adds service_tier field to OpenAIModelSettings to control OpenAI service tier selection.
    • Adds token usage metrics to InstrumentedModel for observability of model calls.
    • Allows users to supply a custom httpx.AsyncClient in MCPServerHTTP for full control over HTTP transport.
    • Supports fileData field (direct file URL) for GeminiModel and GoogleModel, enabling direct URL-based file inputs.
    • Suppresses inapplicable sampling settings (temperature, top_p) when targeting OpenAI reasoning models.
  202. v0.2.16 Jun 8, 2025 · issue -365

    PydanticAI v0.2.16 adds HerokuProvider, stop_sequences for Google models, and LangChain community tool integration.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.16 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.16
    └──▷ USE IT
    Route agent inference through a Heroku-hosted model endpoint.
    python
    from pydantic_ai import Agent
    from pydantic_ai.providers.heroku import HerokuProvider
    
    agent = Agent(provider=HerokuProvider())
    • Adds HerokuProvider to connect agents to Heroku-hosted models.
    • Adds stop_sequences parameter support for Google models.
    • Adds a convenience method to use LangChain community tools directly within PydanticAI agents.
    • Improves output type inference when callables are provided as output types.
  203. v0.2.13 Jun 3, 2025 · issue -365

    PydanticAI v0.2.13 adds expected-output support to LLMJudge evaluations.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.13 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.13
    • Adds option to pass expected output to LLMJudge, enabling reference-based LLM evaluation scoring.
  204. v0.2.12 May 29, 2025 · issue -366

    PydanticAI v0.2.12 adds function output types, ModelProfile config, Together/Fireworks/Grok providers, and Claude 4 on Bedrock.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.12 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.12
    └──▷ USE IT
    Use a plain function as an agent's output type so the model's response directly invokes structured tool-like logic.
    python
    from pydantic_ai import Agent
    
    def send_alert(message: str, severity: str) -> None:
        ...  # your implementation
    
    agent = Agent('openai:gpt-4o', output_type=send_alert)
    result = await agent.run('Notify me if CPU exceeds 90%')
    Route agent calls to Together AI or Fireworks AI using the new dedicated provider classes with automatic model profile selection.
    python
    from pydantic_ai import Agent
    from pydantic_ai.providers.together import TogetherProvider
    
    agent = Agent(TogetherProvider(), model='meta-llama/Llama-3-70b-chat-hf')
    result = await agent.run('Summarize this incident report: ...')
    • Adds ModelProfile class to configure model-specific behaviors independently of the model class, enabling fine-grained control over provider quirks without subclassing.
    • Adds new provider classes for Together AI, Fireworks AI, and Grok with automatic model profile selection.
    • Adds vendor_id and vendor_details.finish_reason fields to Gemini/Google model response objects.
    • Supports functions as output_type in agents, including lists of functions mixed with other types.
    • Adds support for Claude 4 Sonnet and Opus models via the Bedrock provider.
    +1 moreshow less
    • Enhances Gemini usage tracking to collect comprehensive token data beyond basic prompt/completion counts.
  205. v0.2.10 May 27, 2025 · issue -366

    PydanticAI v0.2.10 adds Claude Sonnet 4 support, MCP Streamable HTTP transport, and MCP client init timeouts.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.10 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.10
    • Adds support for Claude Sonnet 4 as a model target.
    • Adds MCP Streamable HTTP transport support, enabling HTTP-based MCP server connections alongside the existing stdio transport.
    • Adds a timeout for initializing MCP clients, preventing indefinite hangs during MCP server startup.
    • Updates supported Google models.
  206. v0.2.9 May 26, 2025 · issue -366

    PydanticAI v0.2.9 adds Vertex AI label support for Gemini/Google models and improves Agent CLI output handling.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.9 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.9
    • Supports labels field for GeminiModel and GoogleModel on Vertex AI, enabling resource labeling for cost attribution and organization.
    • Non-textual responses in Agent.to_cli are now cast to str, allowing the CLI interface to handle structured or binary model outputs.
  207. v0.2.7 May 24, 2025 · issue -366

    PydanticAI v0.2.7 adds MCP tool_prefix namespacing, real-time Anthropic streaming, and a customizable prog_name for CLI agents.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.7 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.7
    └──▷ USE IT
    Namespace tools from two MCP servers that might share names to avoid conflicts and make tool origins clear in logs.
    python
    from pydantic_ai.mcp import MCPServerStdio
    
    search_server = MCPServerStdio('npx', ['-y', '@modelcontextprotocol/server-brave-search'], tool_prefix='search')
    fs_server     = MCPServerStdio('npx', ['-y', '@modelcontextprotocol/server-filesystem', '/tmp'], tool_prefix='fs')
    # Tools are now exposed as 'search_<name>' and 'fs_<name>', and duplicate bare names raise an error.
    • Adds tool_prefix option to MCP servers to namespace tool names and raises an error on conflicting tool names across servers.
    • Makes prog_name customizable on CLI agents, allowing teams to brand or script against a consistent program name.
    • Removes the hardcoded n parameter from OpenAIModel requests, unlocking use of endpoints and deployments that reject that field.
    • Streams tool calls and structured output from Anthropic incrementally as tokens arrive instead of buffering the full response.
    • Supports streaming tool calls from models that pass args as None when a function has no parameters.
  208. v0.2.6 May 21, 2025 · issue -366

    PydanticAI v0.2.6 adds prepare_tools param to Agent and 'openrouter' as a supported OpenAIModel provider.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.6 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.6
    └──▷ USE IT
    Route LLM calls through OpenRouter using the existing OpenAIModel with the new 'openrouter' provider string.
    python
    from pydantic_ai.models.openai import OpenAIModel
    
    model = OpenAIModel('openai/gpt-4o', provider='openrouter')
    • Adds prepare_tools parameter to the Agent class, enabling dynamic control over which tools are presented to the model at runtime.
    • Supports 'openrouter' as a valid string value for the provider parameter of OpenAIModel, enabling routing through OpenRouter.
  209. v0.2.5 May 20, 2025 · issue -366

    PydanticAI v0.2.5 adds OpenRouter and Google GenAI providers, logprobs support, and new instrumentation controls.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.5 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.5
    └──▷ USE IT
    Suppress binary content (images, files) from being sent to your OTel backend to reduce trace payload size.
    python
    from pydantic_ai.settings import InstrumentationSettings
    
    settings = InstrumentationSettings(include_binary_content=False)
    • Adds include_binary_content flag to InstrumentationSettings to control whether binary content is captured in traces; renames the OTel attribute key from content to binary_content for BinaryParts.
    • Adds logprobs to OpenAI model settings and response objects, exposing token-level log probability data.
    • Adds vendor_id field to model response objects.
    • Adds ability to specify the evaluation name for all built-in Evaluators.
    • Adds OpenRouter provider for routing requests across LLM backends.
    +2 moreshow less
    • Adds Google GenAI provider for direct integration with Google's generative AI APIs.
    • Makes capabilities a required field on AgentCard in the fasta2a integration.
    └──▷ BREAKING ON UPGRADE
    • !The OTel attribute key for BinaryParts is renamed from content to binary_content; any dashboards, queries, or processors filtering on the old key will stop matching.
    • !capabilities is now required on AgentCard in fasta2a; existing AgentCard instantiations that omit capabilities will raise a validation error.
  210. v0.2.3 May 13, 2025 · issue -366

    PydanticAI v0.2.3 adds an A2A server, a direct public API, and model-settings support for LLMJudge.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.3 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.3
    • Adds direct public API for invoking models directly.
    • Adds an A2A (Agent-to-Agent) server, enabling agents to communicate via the A2A protocol.
    • Allows ModelSettings to be defined on LLMJudge to control model behavior during evaluations.
  211. v0.2.2 May 13, 2025 · issue -366

    PydanticAI v0.2.2 adds a to_cli() method to Agent for instant command-line interfaces.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.2 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.2
    └──▷ USE IT
    Turn an existing PydanticAI agent into a runnable CLI tool without writing argument-parsing boilerplate.
    python
    agent = Agent(model='openai:gpt-4o', system_prompt='You are a helpful assistant.')
    if __name__ == '__main__':
        agent.to_cli()
    • Adds to_cli() method to the Agent class, enabling any agent to be exposed as a CLI application.
  212. v0.2.1 May 13, 2025 · issue -366

    PydanticAI v0.2.1 adds AWS Profile support, CLI config persistence, and OpenTelemetry BinaryContent tracing.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.1 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.1
    • CLI now stores prompt history and configuration under ~/.pydantic-ai for persistence across sessions.
    • OpenTelemetry integration now sends BinaryContent information in traces.
    • Adds AWS Profile support for authenticating with AWS-backed models.
    • Improves Agent.is_*_node() type narrowing by switching to TypeIs for more precise static analysis.
  213. v0.2.0 May 12, 2025 · issue -366

    PydanticAI v0.2.0 moves usage data into ModelResponse and adds non-string enum support for Gemini.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.2.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.2.0
    └──▷ USE IT
    Access token usage directly from a model response after the return-type change, instead of unpacking a tuple.
    python
    response = await model.request(messages, model_request_parameters)
    print(response.usage)
    • Adds usage field to ModelResponse (defaults to Usage() for backward-compatible deserialization), making token/cost usage directly accessible on every model response and in message history sequences.
    • Adds support for non-string enums in Gemini model integrations.
    └──▷ BREAKING ON UPGRADE
    • !The return type of Model.request changed from tuple[ModelResponse, Usage] to ModelResponse — callers that unpack the two-element tuple will break; usage is now accessed via response.usage.
  214. v0.1.11 May 10, 2025 · issue -366

    PydanticAI v0.1.11 renames the CLI entry point to clai.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.11 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.11
    • Renames the CLI entry point to clai, replacing the previous command name.
    └──▷ BREAKING ON UPGRADE
    • !The CLI command is now clai; any scripts or aliases invoking the old CLI name will break on upgrade.
  215. v0.1.10 May 6, 2025 · issue -366

    PydanticAI v0.1.10 adds extra_headers to ModelSettings and thinking_config to GeminiModel

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.10 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.10
    └──▷ USE IT
    Attach custom HTTP headers (e.g. for routing or auth) to every request made through a PydanticAI agent.
    python
    from pydantic_ai import Agent
    from pydantic_ai.settings import ModelSettings
    
    agent = Agent(
        'openai:gpt-4o',
        model_settings=ModelSettings(extra_headers={'X-Custom-Header': 'my-value'})
    )
    result = agent.run_sync('Hello')
    • Adds extra_headers field to ModelSettings to pass custom HTTP headers to model API calls.
    • Adds thinking_config parameter to GeminiModel to control extended thinking behavior.
    • Allows setting temperature to 0 on BedrockConverseModel for deterministic outputs.
  216. v0.1.9 May 2, 2025 · issue -366

    PydanticAI v0.1.9 adds base_url support for Mistral, richer Anthropic usage details, and multi-modal MCP tool call responses.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.9 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.9
    └──▷ USE IT
    Point the Mistral provider at a self-hosted or alternative Mistral-compatible endpoint instead of the default API.
    python
    from pydantic_ai.providers.mistral import MistralProvider
    
    provider = MistralProvider(base_url='https://my-mistral-instance.example.com/v1')
    • Adds base_url parameter to the Mistral provider, enabling custom or self-hosted Mistral endpoint configuration.
    • Stores additional usage details returned by Anthropic in the response metadata.
    • Handles multi-modal and error responses from MCP tool calls, broadening the range of MCP tool outputs PydanticAI can process.
  217. v0.1.8 Apr 28, 2025 · issue -367

    PydanticAI v0.1.8 lets tools return multi-modal content such as images and audio alongside text.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.8 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.8
    • Tools can now return multi-modal content (e.g. images, audio, binary data) directly from tool functions, not just text or structured data.
  218. v0.1.7 Apr 28, 2025 · issue -367

    PydanticAI v0.1.7 adds Gemini video support, multi-instruction agents, and attribute docstrings on tools by default.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.7 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.7
    • Sets use_attribute_docstrings=True as the default on tools, so attribute-level docstrings are automatically used in tool schemas without explicit configuration.
    • Supports multiple instructions on an Agent, with correct concatenation when more than one instruction is provided.
    • Adds Gemini video support, enabling video content to be passed to Gemini models via the PydanticAI message API.
  219. v0.1.6 Apr 25, 2025 · issue -367

    PydanticAI v0.1.6 adds OpenTelemetry tracing for AudioUrl, VideoUrl, DocumentUrl, and ImageUrl content.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.6 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.6
    • OpenTelemetry spans now include AudioUrl, VideoUrl, DocumentUrl, and ImageUrl content metadata, enabling full observability over multimodal model interactions.
  220. v0.1.4 Apr 24, 2025 · issue -367

    PydanticAI v0.1.4 adds MCP logging, o3/o4-mini support, and OpenAI document input types.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.4 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.4
    └──▷ USE IT
    Target OpenAI's o3 or o4-mini reasoning models in an agent definition.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.openai import OpenAIModel
    
    agent = Agent(OpenAIModel('o3'))
    # or
    agent = Agent(OpenAIModel('o4-mini'))
    • Supports DocumentUrl and BinaryContent document types for OpenAI provider inputs.
    • Adds support for OpenAI o3 and o4-mini models.
    • Supports MCP logging and raises minimum MCP version requirement to 1.6.0.
    • Makes agent and graph runs serializable, enabling persistence and resumption of run state.
    └──▷ BREAKING ON UPGRADE
    • !Minimum MCP version is now 1.6.0; installations using an older MCP version will break.
  221. v0.1.3 Apr 18, 2025 · issue -367

    PydanticAI v0.1.3 adds extra_body to ModelSettings, OpenTelemetry instruction spans, and Gemini 2.5 Flash support.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.3 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.3
    └──▷ USE IT
    Pass provider-specific body parameters that PydanticAI does not natively expose, such as enabling extended thinking on a compatible model.
    python
    from pydantic_ai import Agent
    from pydantic_ai.settings import ModelSettings
    
    agent = Agent(
        'openai:gpt-4o',
        model_settings=ModelSettings(extra_body={'reasoning_effort': 'high'})
    )
    result = agent.run_sync('Explain quantum entanglement.')
    print(result.data)
    • Adds extra_body field to ModelSettings for passing arbitrary additional body parameters to model API requests.
    • Adds OpenTelemetry span events for instructions, making instruction content visible in traces.
    • Adds support for the gemini-2.5-flash-preview-04-17 model.
  222. v0.1.2 Apr 17, 2025 · issue -367

    PydanticAI v0.1.2 exposes StdioServerParameters.cwd for controlling MCP server working directories.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.2 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.2
    └──▷ USE IT
    Launch an MCP stdio server from a specific working directory so relative paths in the server process resolve correctly.
    python
    StdioServerParameters(command='npx', args=['-y', 'my-mcp-server'], cwd='/path/to/project')
    • Exposes StdioServerParameters.cwd parameter, allowing callers to set the working directory for stdio MCP server processes.
  223. v0.1.0 Apr 15, 2025 · issue -367

    PydanticAI v0.1.0 renames result→output, adds VideoUrl for Bedrock, spans on run results, and an instructions parameter.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.1.0 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.1.0
    └──▷ USE IT
    Access OpenTelemetry spans attached to a run result for custom trace export or assertion in tests.
    python
    result = await agent.run('Classify this alert.')
    for span in result.spans:
        print(span.name, span.start_time)
    • Adds VideoUrl input support to BedrockConverseModel for passing video content to the Bedrock Converse API.
    • Adds additional configuration fields to BedrockConverseModel for the Bedrock Runtime API.
    • Adds instructions parameter to agents for supplying system-level instructions at call time.
    • Exposes spans as an attribute on agent/graph runs and run results for OpenTelemetry trace access.
    • Adds support for gemini-2.5-pro-preview-03-25 (paid tier of Gemini 2.5 Pro).
    +1 moreshow less
    • Generalizes JSON schema transformations across model backends.
    └──▷ BREAKING ON UPGRADE
    • !The result field/attribute is renamed to output across agent runs and run results — any code referencing .result will break on upgrade.
    • !format_as_xml has been moved to a new location — imports referencing the old module path will break on upgrade.
  224. v0.0.55 Apr 9, 2025 · issue -367

    PydanticAI v0.0.55 allows empty user prompts in streaming runs and adds a PydanticAI User-Agent header to outbound requests.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.55 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.55
    • Adds a PydanticAI User-Agent header to all outbound HTTP requests, enabling easier identification of traffic in server logs and API dashboards.
    • Supports empty user_prompt values in run_stream, allowing streaming runs to be initiated with no user message.
  225. v0.0.54 Apr 9, 2025 · issue -367

    PydanticAI v0.0.54 adds stop_sequences to ModelSettings, optional user_prompt, and yields the initial graph node during iteration.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.54 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.54
    └──▷ USE IT
    Stop model generation at a known delimiter — useful when parsing structured output from models that don't support native structured output.
    python
    from pydantic_ai import Agent
    from pydantic_ai.settings import ModelSettings
    
    agent = Agent(
        'openai:gpt-4o',
        model_settings=ModelSettings(stop_sequences=['---END---']),
    )
    result = await agent.run('Summarize this document.')
    print(result.output)
    • Adds stop_sequences field to ModelSettings to control where model output is terminated.
    • Makes user_prompt optional, allowing agent invocations without a required user-facing prompt.
    • Graph (and therefore Agent) iteration now yields the initial node, giving callers visibility into the full execution sequence from the start.
  226. v0.0.53 Apr 7, 2025 · issue -367

    PydanticAI v0.0.53 adds OpenAI strict mode support for structured output.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.53 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.53
    • Adds OpenAI strict mode support, enabling stricter schema enforcement when using OpenAI models for structured output generation.
  227. v0.0.52 Apr 3, 2025 · issue -367

    PydanticAI v0.0.52 adds dependency injection support to the evals framework.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.52 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.52
    • Enables passing dependencies into evals, bringing PydanticAI's dependency-injection model to the evaluation framework.
  228. v0.0.51 Apr 3, 2025 · issue -367

    PydanticAI v0.0.51 switches mcp-run-python to Deno and aligns OpenAI model strictness.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.51 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.51
    • Switches the mcp-run-python server runtime from its previous backend to Deno.
    • Matches OpenAI models in strictness, aligning structured-output enforcement with OpenAI's strict mode behavior.
  229. v0.0.49 Apr 1, 2025 · issue -367

    PydanticAI v0.0.49 adds Gemini 2.5 Pro, OpenAI built-in tools, and new OpenAIResponsesModelSettings fields

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.49 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.49
    └──▷ USE IT
    Control response summarization and truncation behaviour when using the OpenAI Responses API.
    python
    from pydantic_ai.models.openai import OpenAIResponsesModelSettings
    
    settings = OpenAIResponsesModelSettings(
        generate_summary=True,
        truncation='auto'
    )
    • Adds generate_summary and truncation fields to OpenAIResponsesModelSettings for controlling response summarization and context truncation.
    • Adds OpenAI built-in tools support, exposing OpenAI-native tool integrations through the PydanticAI interface.
    • Adds Gemini 2.5 Pro model support alongside CLI improvements.
    • Anthropic models now pass ImageUrl and DocumentUrl references directly without downloading content, enabling more efficient media handling.
  230. v0.0.48 Mar 31, 2025 · issue -368

    PydanticAI v0.0.48 adds support for the OpenAI Responses API.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.48 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.48
    • Adds support for the OpenAI Responses API, enabling PydanticAI agents to use OpenAI's newer stateful response interface.
  231. v0.0.47 Mar 31, 2025 · issue -368

    PydanticAI v0.0.47 ships the new pydantic-evals package, read/connect timeouts for Bedrock, and OpenTelemetry spans around tool calls.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.47 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.47
    • Adds read_timeout and connect_timeout settings to the Bedrock provider for finer-grained network control.
    • Introduces the pydantic-evals package, a new library for evaluating AI agent outputs.
    • Wraps every tool call in an OpenTelemetry span for deeper observability into agent execution.
    • Supports passing a plain str as the model argument, broadening how models can be specified at call sites.
    • Allows running under PYTHONOPTIMIZE=1 (stripped assertions) without errors.
  232. v0.0.46 Mar 26, 2025 · issue -368

    PydanticAI v0.0.46 adds headers, timeout, and SSE read timeout to MCPServerHTTP

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.46 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.46
    └──▷ USE IT
    Connect to an authenticated MCP server over HTTP with custom timeouts and authorization headers.
    python
    MCPServerHTTP(
        url='https://mcp.example.com/sse',
        headers={'Authorization': 'Bearer <token>'},
        timeout=30,
        sse_read_timeout=60
    )
    • Adds headers, timeout, and sse_read_timeout parameters to MCPServerHTTP for fine-grained control over HTTP MCP server connections.
    • Uses different HTTP clients based on providers, enabling provider-specific HTTP client behaviour.
  233. v0.0.45 Mar 26, 2025 · issue -368

    PydanticAI v0.0.45 adds user mapping support in OpenAI chat completion requests.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.45 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.45
    • Adds user mapping in OpenAI chat completion requests, allowing callers to pass a user identifier through to the OpenAI API.
  234. v0.0.44 Mar 25, 2025 · issue -368

    PydanticAI v0.0.44 adds a Cohere provider, exposes tool definitions on chat spans, and drops the system parameter from OpenAIModel.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.44 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.44
    • Adds model_request_parameters attribute (containing tool definitions) to chat spans, making tool configurations observable in traces.
    • Adds a Cohere provider class for inference, enabling PydanticAI agents to target Cohere models via the provider pattern.
    • Migrates OpenAI models from max_tokens to max_completion_tokens in requests.
    • Adds function return docstrings to the generated tool description passed to models.
    └──▷ BREAKING ON UPGRADE
    • !The system parameter is removed from OpenAIModel; code that passes system= to OpenAIModel will break on upgrade.
  235. v0.0.43 Mar 21, 2025 · issue -368

    PydanticAI v0.0.43 adds a timestamp field to SystemPromptPart and auto-refreshes Google Vertex tokens on 401.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.43 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.43
    • Adds timestamp field to SystemPromptPart, enabling precise tracking of when system prompts were created.
    • Automatically recreates the access token on HTTP 401 responses for the Google Vertex provider, enabling uninterrupted long-running sessions.
  236. v0.0.42 Mar 19, 2025 · issue -368

    PydanticAI v0.0.42 adds MCP server support, a Python sandbox MCP server, and customizable tool JSON schema generation.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.42 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.42
    • Renames MCPServerSSE to MCPServerHTTP for connecting agents to MCP servers over HTTP (see breaking changes).
    • Adds support for MCP (Model Context Protocol) servers, allowing agents to connect to and use tools exposed via MCP.
    • Adds a built-in MCP server for running Python code in a sandbox environment.
    • Enables overriding JSON schema generation for tools, giving developers control over how tool parameters are described to the model.
    └──▷ BREAKING ON UPGRADE
    • !MCPServerSSE is renamed to MCPServerHTTP; any code referencing MCPServerSSE will break on upgrade.
  237. v0.0.41 Mar 17, 2025 · issue -368

    PydanticAI v0.0.41 adds Anthropic and Mistral provider classes.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.41 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.41
    • Adds Anthropic provider classes for direct integration with Anthropic models.
    • Adds Mistral provider classes for direct integration with Mistral models.
  238. v0.0.40 Mar 15, 2025 · issue -368

    PydanticAI v0.0.40 adds AzureProvider, env-var base URL for OpenAIProvider, state persistence, and Anthropic PDF support.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.40 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.40
    • Adds AzureProvider class for connecting PydanticAI agents to Azure-hosted OpenAI deployments.
    • Adds environment variable support for base URL configuration in OpenAIProvider, removing the need to hard-code endpoints.
    • Adds state persistence support, enabling agents to save and restore conversational state across runs.
    • Adds PDF document support to the Anthropic provider, allowing PDF content to be passed as model input.
  239. v0.0.39 Mar 13, 2025 · issue -368

    PydanticAI v0.0.39 adds Groq provider classes for LLM integration.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.39 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.39
    • Adds Groq provider classes, enabling Groq-hosted models as a PydanticAI LLM backend.
  240. v0.0.38 Mar 13, 2025 · issue -368

    PydanticAI v0.0.38 adds DocumentUrl and BinaryContent document support for passing documents to models.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.38 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.38
    • Adds DocumentUrl class to pass documents to models by URL.
    • Adds document support via BinaryContent for passing raw binary document data to models.
  241. v0.0.37 Mar 12, 2025 · issue -368

    PydanticAI v0.0.37 adds base_url to models, tool name override on decorators, and VertexAI pre-loaded service account support.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.37 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.37
    • Adds base_url parameter to models, and populates server.address and server.port fields in OpenTelemetry spans for tracing.
    • Allows specifying a custom tool name when registering a function with the tool decorator.
    • Supports pre-loaded VertexAI service account info, removing the need to read credentials from disk at runtime.
    • Serializes bytes values as base64 automatically when converting to JSON.
  242. v0.0.36 Mar 7, 2025 · issue -368

    PydanticAI v0.0.36 adds AWS Bedrock Converse API support and expands VertexAI region coverage.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.36 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.36
    • Adds support for the AWS Bedrock Converse API as a new model backend.
    • Expands VertexAIRegion Literal with updated region URLs for broader Vertex AI regional coverage.
  243. v0.0.34 Mar 5, 2025 · issue -368

    PydanticAI v0.0.34 adds Agent.instrument_all(), a pai CLI, and tool names in response events.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.34 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.34
    └──▷ USE IT
    Instrument every agent in your application at startup without modifying each agent definition.
    python
    from pydantic_ai import Agent
    
    Agent.instrument_all()
    • Adds Agent.instrument_all() class method to instrument all agents globally by default, without configuring each agent individually.
    • Adds pai CLI for interacting with PydanticAI from the command line.
    • Adds tool name to tool response events, making it easier to identify which tool produced a given response in streaming or event-driven workflows.
  244. v0.0.33 Mar 5, 2025 · issue -368

    PydanticAI v0.0.33 introduces a new Providers API for configuring model backends.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.33 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.33
    • Adds a Providers API for configuring and supplying model backends to agents.
  245. v0.0.32 Mar 4, 2025 · issue -368

    PydanticAI v0.0.32 adds an instrument param to Agent, supports Claude Sonnet 3.7 and Gemini 2.0 Pro Exp.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.32 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.32
    └──▷ USE IT
    Re-enable OpenTelemetry tracing for an agent after the default changed to off.
    python
    agent = Agent('openai:gpt-4o', instrument=True)
    • Adds instrument param to Agent to opt into OpenTelemetry tracing explicitly, replacing the previous always-on auto-instrumentation.
    • Adds support for claude-sonnet-3-7 model.
    • Adds support for gemini-2.0-pro-exp-02-05 model.
    └──▷ BREAKING ON UPGRADE
    • !OpenTelemetry instrumentation is now DISABLED by default; agents that relied on automatic tracing must now pass instrument=True to Agent(...) explicitly to restore telemetry.
  246. v0.0.31 Mar 3, 2025 · issue -368

    PydanticAI v0.0.31 adds recursive return types, async graph iteration, and improved OpenTelemetry instrumentation.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.31 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.31
    └──▷ USE IT
    Iterate over graph execution asynchronously using the new async Graph.iter context manager.
    python
    async with my_graph.iter(initial_state) as graph_run:
        async for node in graph_run:
            print(node)
    • Supports recursive objects in return_type, enabling agents to return self-referential data structures.
    • Makes Graph.iter an async context manager, enabling asynchronous iteration over graph execution.
    • Replaces the model request span with InstrumentedModel for more structured OpenTelemetry tracing.
    • Replaces all_messages in the agent span with all_messages_events, aligning its format with the InstrumentedModel span.
    └──▷ BREAKING ON UPGRADE
    • !HandleResponseNode is renamed to CallToolsNode — any code referencing HandleResponseNode by name will break.
    • !Graph.iter is now an async context manager — code using it as a sync context manager will break.
    • !The model request span is replaced by InstrumentedModel — any telemetry pipelines filtering on the model request span name will no longer receive it.
    • !The all_messages field in the agent span is replaced by all_messages_events — any telemetry pipelines reading all_messages from agent spans will no longer find it.
  247. v0.0.30 Feb 28, 2025 · issue -369

    PydanticAI v0.0.30 adds GPT-4.5 support, attributes mode for InstrumentedModel, and richer TestModel content inputs.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.30 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.30
    └──▷ USE IT
    Use the new GPT-4.5 preview model in an agent when you want to leverage OpenAI's latest capabilities.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.openai import OpenAIModel
    
    model = OpenAIModel('gpt-4.5-preview')
    agent = Agent(model=model)
    result = agent.run_sync('Summarize the threat landscape for Q1 2025.')
    print(result.data)
    • Adds gpt-4.5-preview as a supported model name for OpenAIModel.
    • Adds attributes mode to InstrumentedModel for OpenTelemetry instrumentation.
    • Supports different content input types in TestModel for richer test scenarios.
    • Replaces the existing streaming implementation with the .iter() API.
  248. v0.0.29 Feb 27, 2025 · issue -369

    PydanticAI v0.0.29 adds max_results parameter to the DuckDuckGo search tool.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.29 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.29
    └──▷ USE IT
    Limit DuckDuckGo search results to a specific count to reduce token usage and focus agent context.
    python
    from pydantic_ai.tools.duckduckgo import DuckDuckGoSearchTool
    
    tool = DuckDuckGoSearchTool(max_results=5)
    • Adds max_results parameter to the DuckDuckGo search tool to control the number of results returned per query.
  249. v0.0.28 Feb 27, 2025 · issue -369

    PydanticAI v0.0.28 adds DuckDuckGo and Tavily search tools, exposes tool_call_id on RunContext, and broadens Anthropic image MIME support.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.28 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.28
    └──▷ USE IT
    Access the tool_call_id inside a tool to correlate a tool invocation with its call context for logging or deduplication.
    python
    from pydantic_ai import Agent, RunContext
    
    agent = Agent('openai:gpt-4o')
    
    @agent.tool
    async def my_tool(ctx: RunContext[None], query: str) -> str:
        call_id = ctx.tool_call_id  # new in v0.0.28
        print(f'Handling call {call_id} for query: {query}')
        return f'result for {query}'
    • Adds tool_call_id field to RunContext, giving tool implementations access to the specific call ID during execution.
    • Adds DuckDuckGoSearch built-in tool for agent web search without an API key.
    • Adds TavilySearch built-in tool for agent web search via the Tavily API.
    • Broadens accepted MIME types for ImageUrl when using Anthropic models, enabling a wider range of image formats.
  250. v0.0.27 Feb 26, 2025 · issue -369

    PydanticAI v0.0.27 adds FallbackModel for automatic model failover

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.27 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.27
    └──▷ USE IT
    Chain multiple LLM providers so your agent automatically retries with the next model on failure.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.fallback import FallbackModel
    from pydantic_ai.models.openai import OpenAIModel
    from pydantic_ai.models.anthropic import AnthropicModel
    
    model = FallbackModel(OpenAIModel('gpt-4o'), AnthropicModel('claude-3-5-sonnet-latest'))
    agent = Agent(model=model)
    result = agent.run_sync('Summarize this report.')
    print(result.data)
    • Adds FallbackModel class to enable automatic failover across multiple LLM backends when a model call fails.
  251. v0.0.26 Feb 25, 2025 · issue -369

    PydanticAI v0.0.26 adds multimodal input support for agents.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.26 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.26
    • Adds multimodal input support, enabling agents to accept non-text content (e.g. images, audio) alongside text messages.
  252. v0.0.25 Feb 24, 2025 · issue -369

    PydanticAI v0.0.25 adds InstrumentedModel with OTel/streaming support and a new GraphRun object for ergonomic agent graph traversal.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.25 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.25
    └──▷ USE IT
    Wrap an existing model with OpenTelemetry instrumentation to trace all LLM calls in your agent.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.instrumented import InstrumentedModel
    from pydantic_ai.models.openai import OpenAIModel
    
    base_model = OpenAIModel('gpt-4o')
    instrumented = InstrumentedModel(base_model)
    agent = Agent(instrumented)
    result = await agent.run('Summarize this document.')
    • Adds InstrumentedModel class to wrap any model with OpenTelemetry instrumentation, using raw OTel and actual event loggers.
    • Adds request_stream support to InstrumentedModel, enabling streaming calls alongside standard instrumented requests.
    • Adds GraphRun object to make use of next more ergonomic when iterating agent graph execution.
    • Adds placeholder API key support for OpenAI-compatible models, easing integration with local or third-party OpenAI-compatible endpoints.
    └──▷ BREAKING ON UPGRADE
    • !The name methods are removed from OpenAI and Mistral model classes; any code calling those methods will break on upgrade.
  253. v0.0.24 Feb 12, 2025 · issue -369

    PydanticAI v0.0.24 adds Gemini 2.0 production models and populates ModelResponse.model_name from live responses.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.24 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.24
    • Populates ModelResponse.model_name automatically from actual model responses, giving agents visibility into which model variant handled a request.
    • Adds new Gemini 2.0 models for production use.
  254. v0.0.23 Feb 7, 2025 · issue -369

    PydanticAI v0.0.23 adds o3 model support, OpenAI reasoning_effort param, and Gemini safety settings.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.23 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.23
    └──▷ USE IT
    Cap reasoning cost on an o3 agent by setting reasoning_effort to 'low', 'medium', or 'high'.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.openai import OpenAIModel
    
    model = OpenAIModel('o3', reasoning_effort='medium')
    agent = Agent(model)
    result = agent.run_sync('Explain zero-day vulnerability triage strategies.')
    print(result.data)
    • Supports reasoning_effort parameter for OpenAIModel, enabling control over reasoning depth on compatible OpenAI models.
    • Adds o3 model support to OpenAIModel.
    • Adds Gemini safety settings support for configuring content safety thresholds on Gemini models.
    └──▷ BREAKING ON UPGRADE
    • !The AgentModel class has been removed.
  255. v0.0.22 Feb 4, 2025 · issue -369

    PydanticAI v0.0.22 adds new Gemini experimental models and support for locally served models without API keys.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.22 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.22
    • Supports locally served models that do not require an API key, enabling use of self-hosted LLM endpoints.
    • Adds new Gemini experimental models to the supported model list.
    • Ports pydantic_ai.Agent internals to use pydantic_graph as its execution backend.
  256. v0.0.21 Jan 30, 2025 · issue -370

    PydanticAI v0.0.21 adds model-specific ModelSettings subclasses, drops OllamaModel in favor of OpenAIModel, and adds Cohere support.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.21 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.21
    • Adds subclasses of ModelSettings to support specialized, per-model request parameters beyond the base settings common to all models.
    • Removes OllamaModel — Ollama is now used via OpenAIModel with the appropriate base URL, consolidating provider support.
    • Adds Cohere model support with documentation and live tests.
    └──▷ BREAKING ON UPGRADE
    • !OllamaModel has been removed; existing code using OllamaModel must be migrated to use OpenAIModel with Ollama's OpenAI-compatible endpoint.
    • !ArgsDict and ArgsJson have been removed from the public API.
    • !AgentDeps type alias is renamed to AgentDepsT.
  257. v0.0.20 Jan 24, 2025 · issue -370

    PydanticAI v0.0.20 adds Cohere model support, Anthropic streaming, parallel tool calls, and DeepSeek-R1 via Ollama.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.20 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.20
    └──▷ USE IT
    Disable parallel tool calls when you need strict sequential tool execution, e.g. to avoid race conditions on shared state.
    python
    from pydantic_ai import Agent
    from pydantic_ai.settings import ModelSettings
    
    agent = Agent('openai:gpt-4o', model_settings=ModelSettings(parallel_tool_calls=False))
    result = agent.run_sync('Book a flight and then a hotel')
    • Adds parallel_tool_calls field to ModelSettings to control whether the model may invoke multiple tools simultaneously.
    • Adds model_name field to ModelResponse, exposing which model produced each response.
    • Adds support for Cohere models as a new model provider integration.
    • Adds 'deepseek-r1' to the recognized Ollama model name list, enabling typed use of DeepSeek-R1 via Ollama.
    • Adds Anthropic streaming support, enabling streamed responses from Anthropic models.
    +2 moreshow less
    • Adds support for user-role system prompts for o1-preview-2024-09-12 to work around that model's system-prompt restrictions.
    • Adds direction control for Mermaid state diagram generation.
    └──▷ BREAKING ON UPGRADE
    • !Removes from_text and from_tool_call utilities, which will break any code that imports or calls these methods.
  258. v0.0.19 Jan 15, 2025 · issue -370

    PydanticAI v0.0.19 adds graph support, tool docstring controls, streaming refactor, and phi4 on Ollama.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.19 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.19
    • Adds docstring_format and require_parameter_descriptions parameters to tool definitions, giving callers explicit control over how tool schemas are generated from Python docstrings.
    • Introduces graph support via pydantic_ai.graph, enabling stateful, multi-step agent workflows modelled as explicit graphs.
    • Adds phi4 model support to the Ollama provider.
    • Refactors streaming internals, improving the reliability and composability of streamed agent responses.
  259. v0.0.18 Jan 7, 2025 · issue -370

    PydanticAI v0.0.18 adds dynamic system prompts, per-run custom result types, and provider-prefixed model names.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.18 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.18
    └──▷ USE IT
    Re-evaluate a system prompt on every run to inject fresh context such as the current user or timestamp.
    python
    @agent.system_prompt(dynamic=True)
    def my_prompt(ctx: RunContext) -> str:
        return f"Today is {date.today()}. User: {ctx.deps.username}"
    Override the expected result type for a single run without redefining the agent — useful for multi-step pipelines with varying output schemas.
    python
    result = await agent.run("Summarise this", result_type=MySummaryModel)
    • Adds dynamic parameter to the system_prompt decorator, enabling system prompts to be re-evaluated on each agent run rather than computed once at definition time.
    • Supports custom result_type overrides on individual .run() calls, allowing the expected output type to be set per-run without changing the agent definition.
    • All model names are now prefixed with their provider (e.g. openai:gpt-4o) for consistency across providers.
    └──▷ BREAKING ON UPGRADE
    • !All models are now prefixed with their provider name for consistency — any hardcoded unprefixed model strings passed to agents may need to be updated to the new provider-prefixed format.
  260. v0.0.17 Jan 3, 2025 · issue -370

    PydanticAI v0.0.17 defaults AgentDeps to None and adds formatting examples support

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.17 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.17
    • Adds formatting examples support to improve how examples are structured and displayed.
    • AgentDeps now defaults to None, simplifying agent definitions that do not require explicit dependency typing.
  261. v0.0.16 Dec 30, 2024 · issue -371

    PydanticAI v0.0.16 adds multi-agent support, extends RunContext, and brings Ollama API key config and nested capture_run_messages.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.16 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.16
    • Adds capture_run_messages support for nested agent calls, enabling message capture across multi-agent workflows.
    • Extends RunContext with additional fields/methods to expose more context inside tool and result functions.
    • Adds Ollama API key configuration support for authenticating against Ollama endpoints.
    • Introduces multi-agent usage patterns, allowing agents to delegate to or call other agents.
    • Adds support for X | None = None optional type annotations with the Gemini provider.
  262. v0.0.15 Dec 23, 2024 · issue -371

    PydanticAI v0.0.15 adds capture_run_messages for message capture and optimizes Mistral model support.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.15 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.15
    • Adds capture_run_messages to replace last_run_messages for capturing run messages.
    • Adds a default to ResultData so agents no longer require an explicit result-type argument.
    • Optimizes Mistral model integration for improved performance.
    • Tool calls are now prioritized over eager text responses when a model returns both.
    └──▷ BREAKING ON UPGRADE
    • !last_run_messages is removed; replace all uses with capture_run_messages.
  263. v0.0.14 Dec 19, 2024 · issue -371

    PydanticAI v0.0.14 adds usage limits, renames Cost to Usage, and supports the openai:o1 model.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.14 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.14
    • Renames Cost to Usage across the library — callers must update any references to the old name.
    • Adds support for usage limits via the new Usage tracking infrastructure.
    • Adds openai:o1 model support.
    └──▷ BREAKING ON UPGRADE
    • !Cost is renamed to Usage — any code referencing Cost will break on upgrade.
  264. v0.0.13 Dec 16, 2024 · issue -371

    PydanticAI v0.0.13 adds Mistral and Anthropic support, new ModelSettings, Gemini 2.0 Flash, and a reworked message format.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.13 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.13
    └──▷ USE IT
    Point an OpenAI-compatible agent at a local or self-hosted inference server without changing the rest of your agent code.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.openai import OpenAIModel
    
    model = OpenAIModel('llama-3', base_url='http://localhost:11434/v1')
    agent = Agent(model)
    result = agent.run_sync('Summarize the threat report.')
    print(result.data)
    Use the new Mistral provider to run an agent against a Mistral model.
    python
    from pydantic_ai import Agent
    from pydantic_ai.models.mistral import MistralModel
    
    agent = Agent(MistralModel('mistral-large-latest'))
    result = agent.run_sync('List the top 5 OWASP API risks.')
    print(result.data)
    • Adds base_url kwarg to OpenAIModel to point the client at any OpenAI-compatible endpoint (e.g. local or self-hosted inference servers).
    • Adds messages field to RunContext so tool functions can inspect the full conversation history mid-run.
    • Adds ToolReturnPart message part to pydantic_ai.messages, emitted for every tool call result and included in the message stream.
    • Adds basic ModelSettings class for passing model-level configuration (temperature, etc.) to agent runs.
    • Adds Mistral model support as a new first-class provider.
    +6 moreshow less
    • Adds non-streaming Anthropic model support.
    • Adds gemini-2.0-flash-exp to the supported Gemini model names.
    • Adds llama-3.3-70b-versatile to GroqModelName.
    • Supports tool calling when a structured result type is also provided, allowing both to be used simultaneously.
    • Reformats message history as a simple list[ModelRequest | ModelResponse], unifying request and response representations across all providers.
    • Streamed response messages are now captured and included in the message history.
    └──▷ BREAKING ON UPGRADE
    • !The message format has changed significantly; existing stored or serialized messages are incompatible with the new list[ModelRequest | ModelResponse] structure.
    • !ToolReturnPart is now emitted for every tool call, adding more message parts than previous releases — code that iterates or counts message parts will see different results.
    • !The field tool_id has been renamed to tool_call_id across message types.
  265. v0.0.12 Dec 9, 2024 · issue -371

    PydanticAI v0.0.12 adds Ollama support, dynamic tools, and tool-result generation for structured outputs.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.12 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.12
    • Adds Ollama as a supported model provider, enabling local LLM inference within PydanticAI agents.
    • Introduces dynamic tools, allowing tool definitions to be resolved or modified at runtime rather than statically at agent construction.
    • Enables tool-result generation when using structured result types, so structured-output workflows now produce proper tool result messages alongside the response.
  266. v0.0.10 Dec 6, 2024 · issue -371

    PydanticAI v0.0.10 adds Agent.name for identifying agents in traces and logs.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.10 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.10
    └──▷ USE IT
    Assign a name to an agent so it appears identifiably in Logfire traces or logs.
    python
    from pydantic_ai import Agent
    
    agent = Agent('openai:gpt-4o', name='support-agent')
    • Adds Agent.name attribute to label agent instances, enabling identification in observability output.
  267. v0.0.9 Dec 4, 2024 · issue -371

    PydanticAI v0.0.9 lets you register tools at Agent construction time and return any type from tool functions.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.9 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.9
    • Adds tools parameter to Agent(tools_=[...]) constructor, allowing tools to be registered at instantiation rather than only via decorators.
    • Allows tool functions to return Any type, removing the previous restriction that tool return values had to be a specific type.
  268. v0.0.6 Nov 25, 2024 · issue -372

    PydanticAI v0.0.6 adds Vertex AI and Groq provider support, plus a slim install option.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.6 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.6
    • Adds VertexAI model support, including recognition of Vertex AI models in infer_model.
    • Adds Groq client support as a new LLM provider.
    • Introduces pydantic-ai-slim as a minimal install target via uv workspaces, with OpenAI now an optional dependency.
  269. v0.0.3 Nov 19, 2024 · issue -372

    PydanticAI v0.0.3 adds streamed responses, dependency override support, and expanded Gemini model coverage.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.3 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.3
    • Adds streamed response support, enabling agents to consume model output incrementally as it arrives.
    • Allows overriding dependencies at runtime (e.g. in testing) via the new dependency override mechanism.
    • Changes Agent initialization to accept a deps type rather than a deps instance, decoupling agent definition from runtime dependencies.
    • Expands Gemini model coverage with additional test and integration support.
    • Adds a chat application example with streaming support to the examples library.
    └──▷ BREAKING ON UPGRADE
    • !The Agent constructor now takes a deps type instead of a deps instance — existing code passing a deps object directly will need to be updated.
    • !ToolCall has been renamed to Structured in most places — code referencing ToolCall by name will break.
  270. v0.0.2 Oct 30, 2024 · issue -373

    PydanticAI v0.0.2 adds timezone support and TypeAliasType union handling.

    └──▷ GET THIS VERSION
    $ git clone --branch v0.0.2 https://github.com/pydantic/pydantic-ai.git
    # already have the repo? check out this version:
    $ git checkout v0.0.2
    • Supports TypeAliasType unions, allowing type aliases defined with Python's TypeAliasType to be used in agent result schemas and tool signatures.
    • Adds timezone support to datetime handling within agents.
my-toolchain — 0 tools
paste an install list to detect your tools

A brew list, a Brewfile, requirements.txt, a Dockerfile — or just the product names, free-form. Nothing leaves your browser.

    browse all tools →