PydanticAI v2.50.0 发布:新增 DecisionModel 与 Gemini 3.8 Live 支持
原标题:v2.50.0 (2026-09-24)
AI 摘要
PydanticAI 发布 v2.50.0,引入 DecisionModel 基类以支持 Decisions 协议的路由决策,并调整了 ModelSelectionContext 的消息与提示结构。该版本新增 Gemini 3.8 Live 实时模型支持、OpenAI service_tier 暴露及 RunContext.in_durable_context,同时修复了实时音频、Anthropic 缓存定价、OpenAI Realtime 推理开关等多项问题。
正文节选
<!-- Release notes generated using configuration in .github/release.yml at main --> ## What's Changed ### ⚠️ Compatibility Notes * Ask a `DecisionModel` which route to take by name, with one label per route by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8733 * Make `ModelSelectionContext.messages` end with the request being routed, and add `ModelSelectionContext.prompt` by @DouweM in https://github.com/pydantic/pydantic-ai/pull/8737 * Replace the decision model's tool-call lean with