Skip to content

pydantic-ai

v2.0.0 Breaking

This release includes 1 breaking change for platform teams planning a safe upgrade.

βœ“ No known CVEs patched
Read the diff β†’ Tool health β†’ What is this tool? β†’

✓ No known CVEs patched in this version

Topics

agent-framework genai llm pydantic python

Affected surfaces

breaking_upgrade

Summary

AI summary

Broad release touches πŸ› Bug Fixes, πŸš€ Features, openai, and cohere.

Full changelog

πŸŽ‰ Pydantic AI V2.0 is here!

After seven betas, Pydantic AI V2 is now stable. V2 leans into a harness-first design with capabilities as a core primitive β€” a single composable unit that bundles an agent's tools, hooks, instructions, and model settings, reaching every layer of the agent through one concept.

Install it with:

uv add pydantic-ai

See the Upgrade Guide for everything that's changed and the recommended path from V1.


What's Changed

πŸš€ Features

  • Add gemini-embedding-2 embedding model by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5887
  • Map AG-UI interrupts to DeferredTools in AGUIAdapter by @jjmllr in https://github.com/pydantic/pydantic-ai/pull/5441
  • Add google_task text-prefix conditioning for gemini-embedding-2 embeddings by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5894
  • feat: add xai_max_turns to XaiModelSettings by @manan-tech in https://github.com/pydantic/pydantic-ai/pull/5978
  • Pydantic AI V2 by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5451

πŸ› Bug Fixes

  • Don't send Gemini function_calling_config without function declarations by @glendigity in https://github.com/pydantic/pydantic-ai/pull/5791
  • fix(openai): map image UploadedFile parts to input_image by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/5809
  • Fix unified thinking handling for Groq qwen3 and Cerebras gpt-oss by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5850
  • Disallow non-finite Evaluator outputs by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/5863
  • Fix AnthropicModel.count_tokens divergence on ToolSearchTool replay history by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5855
  • Send reasoning_content on synthesized tool-call turns for DeepSeek thinking models by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/5842
  • Validate UploadedFile.provider_name in tool returns and consolidate the guard into Model._validate_uploaded_file_provider by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/5860
  • Replay Cerebras zai-glm reasoning in <think> tags and bump to zai-glm-4.7 by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5891
  • Retain dropped usage fields across GoogleModel streaming chunks by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5886
  • Accumulate output_audio_tokens in RunUsage by @HaozheZhang6 in https://github.com/pydantic/pydantic-ai/pull/5904
  • fix(output): validate union kind discriminator in text output by @ret2libc in https://github.com/pydantic/pydantic-ai/pull/5845
  • fix(openai): prevent AG-UI stalls during multi-server MCP discovery by @cooleryu in https://github.com/pydantic/pydantic-ai/pull/5443
  • Forward additionalModelRequestFields in Bedrock count_tokens by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5910
  • Fix MCPToolset(http_client=...) crash on FastMCP's follow_redirects kwarg by @he-yufeng in https://github.com/pydantic/pydantic-ai/pull/5694
  • fix(cohere): forward tool_choice from ModelSettings to v2 chat API by @Julien-ser in https://github.com/pydantic/pydantic-ai/pull/5833
  • Route max_tokens to max_completion_tokens or max_tokens via OpenAIModelProfile flag by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5926
  • Forward top_k model setting to Bedrock additionalModelRequestFields by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5922
  • Fix FallbackModel declaring an unassigned _model_name dataclass field by @dorukgezici in https://github.com/pydantic/pydantic-ai/pull/5932
  • fix(groq): add groq_reasoning_effort setting by @Oxygen56 in https://github.com/pydantic/pydantic-ai/pull/5797
  • fix: use running loop in chat app example by @Ghraven in https://github.com/pydantic/pydantic-ai/pull/5971
  • fix(cohere): forward usage.cached_tokens as cache_read_tokens by @bdpgmbv in https://github.com/pydantic/pydantic-ai/pull/5957
  • fix(mistral): forward penalties in completions by @he-yufeng in https://github.com/pydantic/pydantic-ai/pull/5695
  • Emit reasoning_effort='none' for Cerebras, deprecate cerebras_disable_reasoning, add cerebras_clear_thinking by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5897

New Contributors

  • @glendigity made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5791
  • @Oxygen56 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5809
  • @HaozheZhang6 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5904
  • @ret2libc made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5845
  • @cooleryu made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5443
  • @jjmllr made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5441
  • @strickvl made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5908
  • @Julien-ser made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5833
  • @MylittleQueercat made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5876
  • @Kropiunig made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5928
  • @Nukually made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5813
  • @MakenRosa made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5997
  • @manan-tech made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5978
  • @MeloMei made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5950
  • @kaxil made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5984
  • @pranavmutatkar made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5991
  • @Ghraven made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5971
  • @bdpgmbv made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5957

Full Changelog: https://github.com/pydantic/pydantic-ai/compare/v2.0.0b7...v2.0.0

Breaking Changes

  • Pydantic AI V2 adopts a harness-first design with capabilities as the core primitive, altering API usage and configuration.

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

Share this release

Track pydantic-ai

Get notified when new releases ship.

Sign up free

About pydantic-ai

AI Agent Framework, the Pydantic way

All releases β†’

Related context

Earlier breaking changes

  • v1.95.0 rename β€˜built-in tools’ to β€˜native tools’, deprecate old fields, register via capabilities=[NativeTool(...)]

Beta — feedback welcome: [email protected]