python Pydantic AI Releases · · 2.41.0

Pydantic-AI v2.41.0 Adds Image Generation API, Deprecates `fallback_model`

sdkaideprecationengineerpython-agentic
deprecation feature patch

Pydantic-AI v2.41.0 introduces a direct image generation API via `ImageGenerator` and adds an `openai-codex` provider for ChatGPT/Codex subscription authentication. This release also deprecates the `fallback_model` parameter on `ImageGeneration` and `XSearch` in favor of `fallback_subagent_model`. Bug fixes include reporting Anthropic native web searches in usage details, wrapping botocore transport errors, and refining Gemini thinking levels. These updates enhance AI model interaction capabilities while refining API consistency for developers.

  • Add a direct image generation API with ImageGenerator by @EgonFerri in https://github.com/pydantic/pydantic-ai/pull/5357
  • Wrap botocore transport errors in ModelAPIError in BedrockConverseModel by @kimnamu in https://github.com/pydantic/pydantic-ai/pull/8131
  • Snap Gemini thinking levels to the nearest supported level by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8165
Features (3)
  • 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 @EgonFerri in https://github.com/pydantic/pydantic-ai/pull/5357
Fixes (3)
  • Report Anthropic native web searches in RequestUsage.details and price them in cost by @adtyavrdhn in https://github.com/pydantic/pydantic-ai/pull/8169

  • Wrap botocore transport errors in ModelAPIError in BedrockConverseModel by @kimnamu in https://github.com/pydantic/pydantic-ai/pull/8131
  • Snap Gemini thinking levels to the nearest supported level by @dsfaccini in https://github.com/pydantic/pydantic-ai/pull/8165
Read the original announcement →

https://github.com/pydantic/pydantic-ai/releases/tag/v2.41.0

Related releases