This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new dac0a7adc44 Keep common.ai on anthropic 1.x until pydantic-ai supports
anthropic 2 (#75640)
dac0a7adc44 is described below
commit dac0a7adc44ee030d51fb562e6808e1036f8a22a
Author: Wei Lee <[email protected]>
AuthorDate: Tue Oct 27 05:11:31 2026 +0800
Keep common.ai on anthropic 1.x until pydantic-ai supports anthropic 2
(#75640)
pydantic-ai's Anthropic model (up to 2.59.0) calls BetaMessageParam(...),
which
anthropic 2 turned into a Union, so installing common.ai[anthropic] with
anthropic 2
fails with "Cannot instantiate typing.Union" on the first request.
Cap anthropic below 2 in the extra and the dev group.
---
providers/common/ai/docs/index.rst | 2 +-
providers/common/ai/pyproject.toml | 8 +++++---
uv.lock | 4 ++--
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/providers/common/ai/docs/index.rst
b/providers/common/ai/docs/index.rst
index 8b2322bca01..68152731e5e 100644
--- a/providers/common/ai/docs/index.rst
+++ b/providers/common/ai/docs/index.rst
@@ -227,7 +227,7 @@ Install them when installing from PyPI. For example:
===============
=======================================================================================================================================
Extra Dependencies
===============
=======================================================================================================================================
-``anthropic`` ``pydantic-ai-slim[anthropic]>=2.36.0``, ``anthropic>=1.1.0``
+``anthropic`` ``pydantic-ai-slim[anthropic]>=2.36.0``,
``anthropic>=1.1.0,<2``
``bedrock`` ``pydantic-ai-slim[bedrock]>=2.36.0``
``google`` ``pydantic-ai-slim[google]>=2.36.0``
``openai`` ``pydantic-ai-slim[openai]>=2.36.0``, ``openai>=2.47.0``
diff --git a/providers/common/ai/pyproject.toml
b/providers/common/ai/pyproject.toml
index 151295f51d4..14f46d326b5 100644
--- a/providers/common/ai/pyproject.toml
+++ b/providers/common/ai/pyproject.toml
@@ -89,8 +89,10 @@ dependencies = [
# 2.47.0 is the first release that accepts the httpx2 client
pydantic-ai-slim>=2.33 hands it
# (2.45 and 2.46 raise TypeError on it); pydantic-ai-slim[openai]>=2.33.0
itself asks for
# openai>=3, so this floor only matters where that requirement is overridden,
as in this
-# repository's lock.
-"anthropic" = ["pydantic-ai-slim[anthropic]>=2.36.0", "anthropic>=1.1.0"]
+# repository's lock. anthropic is capped below 2 because pydantic-ai's
Anthropic model
+# (up to 2.59.0) calls BetaMessageParam(...), which anthropic 2 turned into a
Union that
+# cannot be instantiated.
+"anthropic" = ["pydantic-ai-slim[anthropic]>=2.36.0", "anthropic>=1.1.0,<2"]
"bedrock" = ["pydantic-ai-slim[bedrock]>=2.36.0"]
"google" = ["pydantic-ai-slim[google]>=2.36.0"]
"openai" = ["pydantic-ai-slim[openai]>=2.36.0", "openai>=2.47.0"]
@@ -200,7 +202,7 @@ dev = [
# @task.llm_batch's OpenAI/Anthropic adapters call these SDKs directly.
The dev group
# needs them so the adapter tests, which build real SDK models, run
instead of skipping.
"openai>=2.47.0",
- "anthropic>=1.1.0",
+ "anthropic>=1.1.0,<2",
# The code-mode extra, so the tests that run a real CodeMode under durable
execution run.
"pydantic-ai-harness[codemode]>=0.35.0",
"boat-sdk>=1.9.3",
diff --git a/uv.lock b/uv.lock
index e3270f130d9..7cb99ce80d6 100644
--- a/uv.lock
+++ b/uv.lock
@@ -4735,7 +4735,7 @@ docs = [
[package.metadata]
requires-dist = [
- { name = "anthropic", marker = "extra == 'anthropic'", specifier =
">=1.1.0" },
+ { name = "anthropic", marker = "extra == 'anthropic'", specifier =
">=1.1.0,<2" },
{ name = "apache-airflow", editable = "." },
{ name = "apache-airflow-providers-common-compat", editable =
"providers/common/compat" },
{ name = "apache-airflow-providers-common-sql", marker = "extra ==
'common-sql'", editable = "providers/common/sql" },
@@ -4780,7 +4780,7 @@ provides-extras = ["anthropic", "bedrock", "google",
"openai", "typesafe", "mcp"
[package.metadata.requires-dev]
dev = [
- { name = "anthropic", specifier = ">=1.1.0" },
+ { name = "anthropic", specifier = ">=1.1.0,<2" },
{ name = "apache-airflow", editable = "." },
{ name = "apache-airflow-devel-common", editable = "devel-common" },
{ name = "apache-airflow-providers-common-compat", editable =
"providers/common/compat" },