PydanticAI v2.38.0 发布:新增模型支持与多项修复
原标题:v2.38.0 (2026-09-02)
AI 摘要
PydanticAI 发布 v2.38.0 版本,新增了 context_window 字段、gemini-3.8-flash 模型支持,以及 Claude Fable 5.1 和 Claude Mythos 5.1 模型支持。同时修复了多个 bug,包括 DeepSeek 和 Together 的 tool_choice 处理、Bedrock Mantle 历史重放、Anthropic 容器上传等问题。该版本还支持自定义事件和 CapabilityEvent 的订阅,并更新了依赖。
正文节选
<!-- Release notes generated using configuration in .github/release.yml at main --> ## What's Changed ### 🚀 Features * Add `context_window` to `ModelProfile` and `context_window_used` to `RunContext` by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/4611 * Add profile flag to reject streams without `finish_reason` by @jonashaag in https://github.com/pydantic/pydantic-ai/pull/7096 * Add `gemini-3.8-flash` model by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8021 * Let