PydanticAI v2.54.0 发布:兼容性调整与新功能
原标题:v2.54.0 (2026-10-02)
AI 摘要
PydanticAI 发布 v2.54.0,包含多项兼容性调整、新功能和错误修复。兼容性方面处理了 JSON Schema draft-7 列表形式 items、FallbackModel 下的 ImageGeneration、持久执行引擎绑定限制等。新功能包括 clai2 主题化文件差异、/update 自动安装最新构建、OpenAILiveModel 会话重连、WebSearchTool 支持 GPT-Live 等。修复涉及 shell realpath 回退、Gemini 图像生成回退、SnowflakeModel finish_reason 处理等。
正文节选
<!-- Release notes generated using configuration in .github/release.yml at main --> ## What's Changed ### ⚠️ Compatibility Notes * Handle draft-7 list-form `items` in `JsonSchemaTransformer`, `TestModel` and Mistral streamed output, and make `TestModel` accept boolean subschemas and cap `prefixItems` at `maxItems` by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/9560 * Fix `ImageGeneration` under `FallbackModel` and `dataclasses.replace`, and compare `Embedder` by identity by @dsfa