v2.49.0

pydantic/pydantic-aiv2.49.0Sep 24, 2026by DouweM

Upgrading?

AI Summary

This release enhances TypeSafeModel with new criteria and introduces `RealtimeSession.wait_for_reply()`, alongside support for new GPT models on Bedrock and improved handling of Google Cloud Storage references.

Key Highlights

  • Added `BoolCriteria` to define yes/no meanings for boolean fields and enums.
  • Introduced `RealtimeSession.wait_for_reply()` for better real-time interaction handling.
  • Added support for `gpt-6-sol`, `gpt-6-luna`, and `gpt-6-astra` on Bedrock Converse.
  • Fixed `google_proactive_audio` which previously prevented Gemini Live sessions from connecting.

New Features

  • Added `GitHubCopilotOAuthFlow` for device authorization.
  • Added `RealtimeSession.wait_for_reply()` method.
  • Added support for `gpt-6-sol`, `gpt-6-luna`, and `gpt-6-astra` on Bedrock.
  • Forwarded `gs://` references as `fileData` in `GoogleImageGenerationModel`.

Full Release Notes

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

## What's Changed
### 🚀 Features
* Add `GitHubCopilotOAuthFlow` for device authorization by @Kludex in https://github.com/pydantic/pydantic-ai/pull/8618
* Add `BoolCriteria` to say what a `bool` field's yes and no mean, and let a `True`/`False` `Enum` do the same by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8586
* Use what the user wrote about `None` as the "none of these" option in `TypeSafeModel` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8684
* Offer whole numbers that are not a rubric as a `Choice` in `TypeSafeModel` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8686
* Add `RealtimeSession.wait_for_reply()` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8514
### 🐛 Bug Fixes
* Keep all streamed `OpenAIChatModel` logprobs in `provider_details['logprobs']` by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8653
* Allow `gpt-6-sol`, `gpt-6-luna`, and `gpt-6-astra` on Bedrock Converse by @sevakva in https://github.com/pydantic/pydantic-ai/pull/8656
* fix: preserve fanned producer contributions in graph joins by @FIITAY in https://github.com/pydantic/pydantic-ai/pull/8385
* Surface `@GraphBuilder.stream` node errors in-context during `graph.iter()` by [@pydanty](https://github.com/apps/pydanty) in https://github.com/pydantic/pydantic-ai/pull/8304
* Forward Cloud Storage `gs://` references as `fileData` in `GoogleImageGenerationModel` on Vertex AI by @dorukgezici in https://github.com/pydantic/pydantic-ai/pull/8225
* Preserve output tool names and descriptions for `Annotated` model types by @ikriv in https://github.com/pydantic/pydantic-ai/pull/8608
* Type `None` in a list of output types as `| None` so `output_type=[Foo, Bar, None]` passes pyright by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8641
* Fix `google_proactive_audio`, which no Gemini Live session could ever connect with by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8394
* Drop `temperature` and `top_p` for OpenAI GPT-5.6 and GPT-6 on Bedrock Converse instead of failing with a 400 by @kimnamu in https://github.com/pydantic/pydantic-ai/pull/8668
* Let a field's default apply when `TypeSafeModel` answers "None of these" for an optional field by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8685
* Surface realtime receive-side failures to every consumer shape, and end `send_audio(iterable)` cleanly on close by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8138
* Keep `Annotated` metadata on the members of an `X | Y` `output_type` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8687
* Keep an uninstrumented delegate's usage off its caller's agent run span by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8689
* Let a nested model's default apply when `TypeSafeModel` answers "None of these" for every field under it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8697
* Accept `Annotated`, `Literal` and union `output_type`s as PEP 747 `TypeForm`s, and bump pyright to 1.1.414 by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8690
* Make `RunContext.tracer`, `trace_include_content` and `instrumentation_version` follow an explicit `Instrumentation` capability by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8706
* Send deferred tools with native tool search on `OpenAICodexModel` instead of failing with a 400 by @aweis89 in https://github.com/pydantic/pydantic-ai/pull/8693

## New Contributors
* @FIITAY made their first contribution in https://github.com/pydantic/pydantic-ai/pull/8385
* @ikriv made their first contribution in https://github.com/pydantic/pydantic-ai/pull/8608
* @aweis89 made their first contribution in https://github.com/pydantic/pydantic-ai/pull/8693

**Full Changelog**: https://github.com/pydantic/pydantic-ai/compare/v2.48.0...v2.49.0

Related Repositories