v1.84.0

pydantic/pydantic-aiv1.84.0Apr 17, 2026by DouweM

AI Summary

This release includes a security fix for Google FileSearchTool and adds support for Claude Opus 4.7 and stateful compaction. It also improves Ollama integration for structured output.

Key Highlights

  • Security fix for exponential-time regex in Google FileSearchTool
  • Add Claude Opus 4.7 support
  • Add stateful compaction mode to OpenAICompaction
  • Fix structured output on Ollama Cloud

New Features

  • Claude Opus 4.7 support
  • Stateful compaction mode
  • OllamaModel subclass

Full Release Notes

<!-- Release notes generated using configuration in .github/release.yml at main -->

## What's Changed
### :lock: Security
* Fix exponential-time regex in Google `FileSearchTool` response parsing by @DouweM in #5106. This was first released in yesterday's v1.83.0. The pattern was reachable in principle from Gemini streaming responses but could not be triggered via real Gemini output in testing, so we're treating it as a hardening fix rather than a vulnerability.
### 🚀 Features
* Add Claude Opus 4.7 support by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/5118
* Add stateful compaction mode to `OpenAICompaction` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5108
* Add `OllamaModel` subclass and correct Ollama capability flags to fix structured output on Ollama Cloud by @Goldokpa in https://github.com/pydantic/pydantic-ai/pull/4160
### 🐛 Bug Fixes
* Fix deferred tool search keyword matching by @pandego in https://github.com/pydantic/pydantic-ai/pull/5014
* Fixing parsing `openai_logprobs` for streamed responses by @iAmir97 in https://github.com/pydantic/pydantic-ai/pull/5091
* fix(openai): handle null text in Responses API output by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5124
* Chain OpenAI Responses retries through concrete `openai_previous_response_id` seeds by @DouweM in https://github.com/pydantic/pydantic-ai/pull/5126
* fix: exclude resumed requests from `new_messages()` even with current `run_id` by @madanlalit in https://github.com/pydantic/pydantic-ai/pull/4731

## New Contributors
* @iAmir97 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/5091

**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v1.83.0...v1.84.0