Pydantic AI v2.49.0 Enhances LLM Integrations and Type-Safe Model Handling
Pydantic AI v2.49.0 introduces several new features, including a GitHub Copilot OAuth flow for device authorization and improved `TypeSafeModel` capabilities for handling boolean fields and `None` values. This release also provides fixes for a range of bugs across `OpenAIChatModel`, AWS Bedrock Converse, Google Vertex AI, and `GraphBuilder` functionality. These updates aim to provide greater flexibility in model definition, enhance integration with various AI services, and improve the reliability of AI agent development. Developers leveraging Pydantic AI for LLM-powered applications will benefit from these advancements and stability improvements.
- →Add GitHubCopilotOAuthFlow for device authorization by @Kludex in https://github.com/pydantic/pydantic-ai/pull/8618
- →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
- →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
- →preserve fanned producer contributions in graph joins by @FIITAY in https://github.com/pydantic/pydantic-ai/pull/8385
Features (5) ›
- 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
Fixes (17) ›
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 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_types as PEP 747 TypeForms, 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
https://github.com/pydantic/pydantic-ai/releases/tag/v2.49.0
Related releases
- pydantic-ai v2.51.0 Adds OpenAI GPT-Live Support and Refines AI Model Compatibility Pydantic AI Releases ·
- Google ADK for Python v2.10.0 Boosts Skill Lifecycles, DB Integrations, and Eval Metrics Google ADK (Python) Releases ·
- Pydantic-AI v2.50.0 Introduces DecisionModel and Gemini Realtime Support Pydantic AI Releases ·
- LangChain LangGraph CLI Updates to Version 0.4.32.dev0 LangGraph Releases ·
- LangGraph CLI 0.4.32 Enhances Deployments, Agent Flags, and Addresses Vulnerabilities LangGraph Releases ·
- Pydantic-AI v2.48.0 adds support for new OpenAI and Claude models Pydantic AI Releases ·