pypi pydantic-ai 2.4.0
v2.4.0 (2026-07-02)

6 hours ago

What's Changed

🚀 Features

  • Split preserve_file_data into allow_uploaded_files (inbound security) and an AG-UI representation opt-in by @DouweM in #6232
  • Add GEval evaluator and standard quality metric rubrics for LLMJudge by @dmontagu in #5129
  • Add agentic span-based evaluators (ToolCorrectness, TrajectoryMatch, ArgumentCorrectness, MaxToolCalls, MaxModelRequests) by @dmontagu in #5130

🐛 Bug Fixes

  • fix(xai): update XSearchTool handle limit by @gyx09212214-prog in #5979
  • Handle None metadata in Gradio weather agent example by @hramezani in #6214
  • fix(mistral): preserve extended usage fields from API response by @felipebridge in #5693
  • Avoid mutable default argument in process_tool_calls by @kratos0718 in #6189
  • feat: forward WebSearchTool.user_location to xAI web search by @manan-tech in #6181
  • Clean up the pending task and streams on KeyboardInterrupt in synchronous run_until_complete wrappers by @DouweM in #6198
  • fix(tool-search): drop redundant description from ToolSearchMatch by @serozhenka in #5654
  • fix(temporal): pass through genai_prices and httpx2 for workflow cost() by @syf2211 in #6219
  • fix(evals): reject non-positive max_concurrency by @VectorPeak in #6228
  • Lazy-start run_stream_events() background task on first event iteration by @DouweM in #6234

📦 Dependencies

New Contributors

Full Changelog: v2.3.0...v2.4.0

Don't miss a new pydantic-ai release

NewReleases is sending notifications on new releases.