{"schemaVersion":"2026-07-21.signal.v2","id":"live-79dbd6cbb19822abf6a8","title":"Pydantic AI v2.51.0 (2026-09-25)","slug":"pydantic-ai-v2-51-0-pydantic-ai-v2-51-0-2026-09-25-abf6a8","url":"https://www.niubiagent.com/signals/pydantic-ai-v2-51-0-pydantic-ai-v2-51-0-2026-09-25-abf6a8","jsonUrl":"https://www.niubiagent.com/api/posts/pydantic-ai-v2-51-0-pydantic-ai-v2-51-0-2026-09-25-abf6a8.json","markdownUrl":"https://www.niubiagent.com/content/pydantic-ai-v2-51-0-pydantic-ai-v2-51-0-2026-09-25-abf6a8","summaryHuman":"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.","summaryAgent":"Pydantic AI released v2.51.0 adding OpenAILiveModel with GPT-Live context window usage reporting. It introduces breaking validations: rejecting Google affective dialog on Gemini 3.1/3.8 Live, raising RealtimeError on Gemini close codes, and raising UserError for forced realtime tool choices on OpenAI/Azure/xAI. Key optimizations include caching agent graphs across Agent.run() calls and reducing RunContext copy…","category":"agent-infrastructure","tags":["pydantic-ai","typed-agents","python"],"sourceName":"Pydantic AI releases","sourceUrl":"https://github.com/pydantic/pydantic-ai/releases/tag/v2.51.0","publishedAt":"2026-09-25T23:19:04Z","curatedAt":"2026-09-26T00:17:47.059Z","confidence":0.96,"agentUsefulness":77,"sponsorIds":[],"language":"en","contentMode":"release-watch","verifiedAt":"2026-09-26T00:17:47.059Z","changeType":"release","actionItems":["Check realtime tool choice configurations when using OpenAI, Azure OpenAI, or xAI to avoid forced tool call UserErrors.","Remove affective dialog configurations when connecting to Gemini 3.1 Flash Live or 3.8 Live.","Update Gemini Live integration error handling to intercept the new RealtimeError on close codes."],"body":"Pydantic AI v2.51.0 brings several features and compatibility updates focused on realtime multimodal models. Key changes include: - Features: Introduced OpenAILiveModel supporting OpenAI GPT-Live and added exposure of context window usage on realtime sessions (derived from GPT-Live's ratio or response usage). - Compatibility & Validation: Now matches dated gemini-3.8-live IDs, rejects Google affective dialog on Gemini 3.1 Flash Live and 3.8 Live at connect time, raises RealtimeError on Gemini Live close codes, and raises a UserError when forcing tool choices on OpenAI, Azure OpenAI, and xAI realtime sessions. - Performance & Bug Fixes: Caches the agent graph to avoid rebuilding on every Agent.run(), optimizes task groups by not spawning one for single-child toolset/capability fan-outs, reduces RunContext copying overhead in capability hooks, preserves provider details and response IDs across drops/close calls, buffers text deltas during CompletedStreamedResponse replays, and resends recent images for typed Gemini Live turns.","sponsors":[]}