python Pydantic AI Releases · · 2.10.0

pydantic-ai v2.10.0: Tool pairing, OpenAI/Anthropic support, bug fixes

sdkaisecuritysecurity-advisoryengineerpython-agentic
feature patch

Version 2.10.0 of pydantic-ai enhances tool integration by improving message history provider validation and adding support for OpenAI background mode and Anthropic pauses. It also addresses several bugs, including issues with usage details, tool renaming, UTF-8 handling, event-loop affinity, and tool call attachment. A dependency update to `transformers` addresses a security vulnerability, affecting users of these libraries.

  • Fix has_values() returning True for all-zero usage details by @sean-kim05 in https://github.com/pydantic/pydantic-ai/pull/6466
  • Fix RenamedToolset silently dropping a tool on a name collision by @sean-kim05 in https://github.com/pydantic/pydantic-ai/pull/6462
  • Preserve invalid UTF-8 bytes in instrumentation serialization by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/6483
  • Fix event-loop affinity in run_stream_sync by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6454
  • Attach xAI ToolCallPart to the preceding reasoning message by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5924
Features (2)
  • Make message_history provider-valid out of the box (repair tool-call/result pairing) by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6319

  • Add support for OpenAI background mode and handle Anthropic stop_reason=pause_turn by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6303

Fixes (7)
  • Fix has_values() returning True for all-zero usage details by @sean-kim05 in https://github.com/pydantic/pydantic-ai/pull/6466
  • Fix RenamedToolset silently dropping a tool on a name collision by @sean-kim05 in https://github.com/pydantic/pydantic-ai/pull/6462
  • Preserve invalid UTF-8 bytes in instrumentation serialization by @alexmojaki in https://github.com/pydantic/pydantic-ai/pull/6483
  • Fix event-loop affinity in run_stream_sync by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/6454
  • Attach xAI ToolCallPart to the preceding reasoning message by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5924
  • Filter unconfigured Anthropic native tool calls by @hxaxd in https://github.com/pydantic/pydantic-ai/pull/6463
  • Fix DeferredToolResults resume when an output tool call was settled in the same batch as deferred calls by @DouweM in https://github.com/pydantic/pydantic-ai/pull/6491

Read the original announcement →

https://github.com/pydantic/pydantic-ai/releases/tag/v2.10.0

Related releases