Pydantic-AI v2.46.0 Enhances Type-Safe Models, Tooling, and Real-Time AI Sessions
Pydantic-AI v2.46.0 introduces several new features improving interaction with AI models and real-time functionality. Key enhancements include expanded capabilities for `TypeSafeModel` to fill tool arguments and handle union output types, alongside new real-time session controls like `wait_for_playback()`. The release also adds support for streaming agent events via Workflow Streams and improves model profiling with `supports_text_output`. Numerous bug fixes address issues with tool call dispatch, error handling, and cost accounting in real-time sessions.
- →Let TypeSafeModel fill a tool's arguments when Jev can express them by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8501
- →Add typesafe_boolean_threshold for what a yes/no has to be before it is True by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8505
- →Let TypeSafeModel fill a union of output types by choosing the type first by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8481
- →Add a Choices helper for a set of described options built at run time by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8530
- →Refuse more options than Jev can pick from in TypeSafeModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8484
Features (8) ›
- Let TypeSafeModel fill a tool's arguments when Jev can express them by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8501
Add RealtimeSession.wait_for_playback() and let the docs examples finish the reply before closing by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8141
Add supports_text_output to ModelProfile, and run LLMJudge and GEval on a model without it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8480
- Add typesafe_boolean_threshold for what a yes/no has to be before it is True by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8505
- Let TypeSafeModel fill a union of output types by choosing the type first by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8481
Add event_stream_topic to TemporalDurability to stream agent events via Workflow Streams by @brianstrauch in https://github.com/pydantic/pydantic-ai/pull/6639
Describe an Enum's options by its member docstrings when it mixes in UseEnumMemberDocstrings by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8479
- Add a Choices helper for a set of described options built at run time by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8530
Fixes (10) ›
- Refuse more options than Jev can pick from in TypeSafeModel by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8484
Record a failed ToolReturnPart when a realtime tool raises, and keep a tool call and its speech in one ModelResponse by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8135
Dispatch tool calls with the live ToolDefinition in CombinedToolset and FunctionToolset by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8082
- Allow adaptive thinking with tool output and forced tool choice on Bedrock by @pydanty in https://github.com/pydantic/pydantic-ai/pull/7967
- Fix gateway IDs being misclassified as OpenAI o-series models by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8512
Keep late realtime input transcripts attached to the user turn they belong to by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8139
- Lay the first-run banner out for the terminal's actual width by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8517
- Raise ModelRetry when web_fetch_tool gets a URL httpx2 rejects as invalid by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8521
Price realtime responses so usage.cost and UsageLimits.cost_limit work in a session by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8136
- Re-arm coverage for code already seen when the dataclass walk resumes it by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8438
https://github.com/pydantic/pydantic-ai/releases/tag/v2.46.0
Related releases
- ADK-Python v2.9.2 Refines OpenTelemetry Event Naming for Consistent Tracking Google ADK (Python) Releases ·
- Pydantic AI Library v2.45.0 Adds TypeSafeModel and Bedrock Converse Support Pydantic AI Releases ·
- OpenAI Python Agents Library v0.22.3 Delivers Core Fixes and Dependency Updates OpenAI Agents SDK (Python) Releases ·
- Pydantic AI v1.107.6 Delivers Critical Security Fixes Backported from v2.44.0 Pydantic AI Releases ·
- Pydantic-AI v2.44.0 Addresses Four Security Vulnerabilities and Adds New Features Pydantic AI Releases ·
- CrewAI 1.15.22 Enhances Agent Capabilities and Adds New LLM Integrations CrewAI Releases ·