Pydantic AI v2.51.0 (2026-09-25)
Pydantic AI v2.51.0 introduces OpenAILiveModel support, context window tracking for realtime sessions, compatibility adjustments for Gemini Live and OpenAI/Azure/xAI tool choices, and multiple performance optimizations.
原始内容为英文;当前页面提供中文导航与来源说明,具体事实请以原文为准。
为什么值得关注
Pydantic AI version 2.51.0 brings several realtime model updates and performance enhancements. Features include the addition of OpenAILiveModel for OpenAI GPT-Live support and exposure of context window usage on realtime sessions via reported ratios or response usage. Breaking/compatibility updates enforce UserError when attempting to force realtime tool choices on OpenAI, Azure OpenAI, and xAI, reject Google affective dialog on Gemini 3.1 Flash Live and 3.8 Live during connection, handle dated gemini-3.8-live IDs, and raise RealtimeError for Gemini Live close codes. Bug fixes and performance improvements include caching the agent graph across Agent.run() calls, avoiding task groups for single-child toolset fan-outs, buffering text deltas during CompletedStreamedResponse replays, and preserving provider details on truncated or completed OpenAI Realtime tool-call responses.
可执行摘要
Pydantic AI v2.51.0 adds OpenAILiveModel and context window tracking for realtime sessions. Compatibility changes include raising UserError on forced realtime tool choices for OpenAI, Azure OpenAI, and xAI, handling dated gemini-3.8-live IDs, and raising RealtimeError on Gemini Live close codes. Core optimizations cache the agent graph during Agent.run() and eliminate redundant task groups.
- Agent 实用度
- 77/100
- 可信度
- 96%
- 机器格式
- JSON + Markdown
开发者应核对什么
- Verify realtime tool choice configurations to avoid UserError if previously forcing tool calls on OpenAI, Azure OpenAI, or xAI.
- Update Gemini Live integrations to handle RealtimeError on close codes and remove affective dialog usage on Gemini 3.1 Flash Live and 3.8 Live.