PydanticAI v2.41.0 发布:新增图像生成 API 与 OpenAI Codex 支持
原标题:v2.41.0 (2026-09-07)
AI 摘要
PydanticAI 发布 v2.41.0 版本,新增了 openai-codex 提供商以支持 ChatGPT/Codex 订阅认证,并引入了直接的图像生成 API(ImageGenerator)。同时,弃用了 ImageGeneration 和 XSearch 上的 fallback_model,改为 fallback_subagent_model。此外,修复了多个 bug,包括 Anthropic 原生网络搜索的使用报告与计费、Bedrock 传输错误封装以及 Gemini 思考级别对齐问题。
正文节选
<!-- Release notes generated using configuration in .github/release.yml at main --> ## What's Changed ### 🚀 Features * Deprecate `fallback_model` in favor of `fallback_subagent_model` on `ImageGeneration` and `XSearch` by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8077 * Add `openai-codex` provider for ChatGPT/Codex subscription authentication by @mpfaffenberger in https://github.com/pydantic/pydantic-ai/pull/7769 * Add a direct image generation API with `ImageGenerator` by @Ego