diff --git a/providers/common/ai/README.rst b/providers/common/ai/README.rst index 06fd5e0eff958..157cc06918f84 100644 --- a/providers/common/ai/README.rst +++ b/providers/common/ai/README.rst @@ -56,7 +56,7 @@ PIP package Version required ``apache-airflow`` ``>=3.0.0`` ``apache-airflow-providers-common-compat`` ``>=1.15.0`` ``apache-airflow-providers-standard`` ``>=1.12.1`` -``pydantic-ai-slim`` ``>=2.23.0`` +``pydantic-ai-slim`` ``>=2.33.0`` ========================================== ================== Optional cross provider package dependencies diff --git a/providers/common/ai/docs/index.rst b/providers/common/ai/docs/index.rst index a98b1df502f74..0dc2243ec964b 100644 --- a/providers/common/ai/docs/index.rst +++ b/providers/common/ai/docs/index.rst @@ -247,7 +247,7 @@ PIP package Version required ``apache-airflow`` ``>=3.0.0`` ``apache-airflow-providers-common-compat`` ``>=1.15.0`` ``apache-airflow-providers-standard`` ``>=1.12.1`` -``pydantic-ai-slim`` ``>=2.23.0`` +``pydantic-ai-slim`` ``>=2.33.0`` ========================================== ================== Optional cross provider package dependencies @@ -284,12 +284,12 @@ Install them when installing from PyPI. For example: ============== ======================================================================================================================================= Extra Dependencies ============== ======================================================================================================================================= -``anthropic`` ``pydantic-ai-slim[anthropic]>=2.23.0``, ``anthropic>=1.0.0`` -``bedrock`` ``pydantic-ai-slim[bedrock]>=2.23.0`` -``google`` ``pydantic-ai-slim[google]>=2.23.0`` -``openai`` ``pydantic-ai-slim[openai]>=2.23.0``, ``openai>=2.45.0`` +``anthropic`` ``pydantic-ai-slim[anthropic]>=2.33.0``, ``anthropic>=1.0.0`` +``bedrock`` ``pydantic-ai-slim[bedrock]>=2.33.0`` +``google`` ``pydantic-ai-slim[google]>=2.33.0`` +``openai`` ``pydantic-ai-slim[openai]>=2.33.0``, ``openai>=2.47.0`` ``typesafe`` ``typesafe-sdk>=0.6.0`` -``mcp`` ``pydantic-ai-slim[mcp]>=2.23.0`` +``mcp`` ``pydantic-ai-slim[mcp]>=2.33.0`` ``modal`` ``modal>=1.5.0`` ``code-mode`` ``pydantic-ai-harness[codemode]>=0.3.0`` ``shields`` ``pydantic-ai-shields>=0.3.4`` @@ -299,7 +299,7 @@ Extra Dependencies ``sql`` ``apache-airflow-providers-common-sql>=1.33.0``, ``sqlglot>=30.0.0`` ``common.sql`` ``apache-airflow-providers-common-sql>=1.33.0`` ``langchain`` ``langchain>=1.0.0`` -``llamaindex`` ``dataclasses-json>=0.6.7``, ``llama-index-core>=0.13.0``, ``llama-index-embeddings-openai>=0.6.0``, ``llama-index-llms-openai>=0.6.0`` +``llamaindex`` ``dataclasses-json>=0.6.7``, ``llama-index-core>=0.14.5``, ``llama-index-embeddings-openai>=0.6.0``, ``llama-index-llms-openai>=0.6.8`` ``pdf`` ``pypdf>=4.0.0`` ``docx`` ``python-docx>=1.0.0`` ``git`` ``apache-airflow-providers-git`` diff --git a/providers/common/ai/pyproject.toml b/providers/common/ai/pyproject.toml index 94d5204eb54dc..a92d0efbbec6f 100644 --- a/providers/common/ai/pyproject.toml +++ b/providers/common/ai/pyproject.toml @@ -70,32 +70,35 @@ dependencies = [ "apache-airflow>=3.0.0", "apache-airflow-providers-common-compat>=1.15.0", "apache-airflow-providers-standard>=1.12.1", # use next version - # Requires the pydantic-ai cost API (RunUsage.cost, UsageLimits.cost_limit), - # landed in 2.23.0 via https://github.com/pydantic/pydantic-ai/pull/2684. - "pydantic-ai-slim>=2.23.0", + # 2.33.0 is the first release that works with anthropic>=1: it moved to httpx2 alongside + # the SDK and stopped passing temperature/top_p/top_k as messages.create() kwargs, both + # of which raise TypeError on 2.31 and earlier. The cost API this provider relies on + # (RunUsage.cost, UsageLimits.cost_limit) landed earlier, in 2.23.0. + "pydantic-ai-slim>=2.33.0", ] # The optional dependencies should be modified in place in the generated file # Any change in the dependencies is preserved when the file is regenerated [project.optional-dependencies] # @task.llm_batch talks to the provider batch APIs through the vendor SDKs directly, since -# pydantic-ai has no batch abstraction. anthropic 1.0.0 is the first stable major; openai -# 2.45.0 is the floor pydantic-ai-slim[openai]>=2.23.0 already imposes. -"anthropic" = ["pydantic-ai-slim[anthropic]>=2.23.0", "anthropic>=1.0.0"] -"bedrock" = ["pydantic-ai-slim[bedrock]>=2.23.0"] -"google" = ["pydantic-ai-slim[google]>=2.23.0"] -"openai" = ["pydantic-ai-slim[openai]>=2.23.0", "openai>=2.45.0"] +# pydantic-ai has no batch abstraction. anthropic 1.0.0 is the first stable major. openai +# 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.33.0", "anthropic>=1.0.0"] +"bedrock" = ["pydantic-ai-slim[bedrock]>=2.33.0"] +"google" = ["pydantic-ai-slim[google]>=2.33.0"] +"openai" = ["pydantic-ai-slim[openai]>=2.33.0", "openai>=2.47.0"] # TypeSafe Jev: answers typed questions (pick one of N, a bounded score, a yes/no # probability) and cannot emit text, so it fits a branch or a classification but not a # summary. It arrives through pydantic-ai's own ``typesafe:`` provider, so the hook needs # no changes -- setting ``model_id`` or the connection's Model field is the integration. # The adapter itself ships inside pydantic-ai-slim from 2.45.0 (pydantic/pydantic-ai#8450); # this extra only adds the pre-1.0 typesafe-sdk it talks to, which is why it is opt-in. It -# deliberately does not raise the pydantic-ai-slim floor: from 2.31 the ``openai`` extra -# needs openai>=3.8 while llama-index-llms-openai and the Google provider's litellm need -# openai<3, so a higher floor makes the workspace unsatisfiable. The guide says 2.45+. +# deliberately does not raise the pydantic-ai-slim floor to 2.45; the guide says 2.45+. "typesafe" = ["typesafe-sdk>=0.6.0"] -"mcp" = ["pydantic-ai-slim[mcp]>=2.23.0"] +"mcp" = ["pydantic-ai-slim[mcp]>=2.33.0"] # Modal-hosted sandboxes for SandboxToolset, the backend to use where the worker host # cannot run microVMs -- Kubernetes, most notably. Needs no host-level installation, # only Modal credentials. @@ -133,11 +136,14 @@ dependencies = [ "langchain" = [ "langchain>=1.0.0", ] +# llama-index-llms-openai 0.6.8 is the first release that works with openai 2.x and whose +# metadata matches its imports (0.6.0 declares llama-index-core>=0.13.0 but needs the +# ThinkingBlock type core only gained in 0.14); it requires llama-index-core>=0.14.5. "llamaindex" = [ "dataclasses-json>=0.6.7", - "llama-index-core>=0.13.0", + "llama-index-core>=0.14.5", "llama-index-embeddings-openai>=0.6.0", - "llama-index-llms-openai>=0.6.0", + "llama-index-llms-openai>=0.6.8", ] "pdf" = ["pypdf>=4.0.0"] "docx" = ["python-docx>=1.0.0"] @@ -156,16 +162,16 @@ dev = [ "apache-airflow-providers-standard", # Additional devel dependencies (do not remove this line and add extra development dependencies) "sqlglot>=30.0.0", - "pydantic-ai-slim[mcp]>=2.23.0", + "pydantic-ai-slim[mcp]>=2.33.0", "pydantic-ai-skills>=1.2.0", "apache-airflow-providers-common-sql[datafusion]", "langchain>=1.0.0", - "llama-index-core>=0.13.0", + "llama-index-core>=0.14.5", "llama-index-embeddings-openai>=0.6.0", - "llama-index-llms-openai>=0.6.0", + "llama-index-llms-openai>=0.6.8", # @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.45.0", + "openai>=2.47.0", "anthropic>=1.0.0", ] diff --git a/pyproject.toml b/pyproject.toml index 14af9aa3600f9..e9e765957b901 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1442,6 +1442,17 @@ ci-image = [ # floor; `scripts/ci/prek/upgrade_important_versions.py` deliberately skips it. required-version = ">=0.11.8" no-build-isolation-package = ["sphinx-redoc"] +# pydantic-ai-slim[openai]>=2.33 declares openai>=3 (>=3.8 from 2.39), while +# llama-index-llms-openai (<=0.8.1) and litellm (<=1.102.0, pulled in by the Google provider's +# google-cloud-aiplatform[evaluation]) still cap openai below 3. Without this override the +# workspace lock cannot move pydantic-ai-slim past 2.31, which is incompatible with anthropic +# 1.x, so the Anthropic path could not run in the CI image at all. Holding openai on 2.x is the +# pairing constraints-main already ships and the one `pip check` in the image build accepts +# (pip ignores extra-gated requirements, but not llama-index's unconditional cap). pydantic-ai's +# OpenAI model works against openai 2.x at runtime; the declared floor tracks the SDK's httpx2 +# move. Published wheels are unaffected: overrides only shape uv.lock and the CI image. Drop this +# once run-llama/llama_index#22939 and BerriAI/litellm#40317 land and both allow openai 3. +override-dependencies = ["openai>=2.47.0,<3"] # Synchroonize with scripts/ci/prek/upgrade_important_versions.py exclude-newer = "4 days" diff --git a/uv.lock b/uv.lock index a47f2392617fb..ab4c7c10ab124 100644 --- a/uv.lock +++ b/uv.lock @@ -315,6 +315,7 @@ members = [ "apache-airflow-task-sdk", "apache-airflow-task-sdk-integration-tests", ] +overrides = [{ name = "openai", specifier = ">=2.47.0,<3" }] [[package]] name = "a2wsgi" @@ -4703,22 +4704,22 @@ requires-dist = [ { name = "fastavro", marker = "python_full_version >= '3.14' and extra == 'avro'", specifier = ">=1.12.1" }, { name = "fastavro", marker = "python_full_version < '3.14' and extra == 'avro'", specifier = ">=1.10.0" }, { name = "langchain", marker = "extra == 'langchain'", specifier = ">=1.0.0" }, - { name = "llama-index-core", marker = "extra == 'llamaindex'", specifier = ">=0.13.0" }, + { name = "llama-index-core", marker = "extra == 'llamaindex'", specifier = ">=0.14.5" }, { name = "llama-index-embeddings-openai", marker = "extra == 'llamaindex'", specifier = ">=0.6.0" }, - { name = "llama-index-llms-openai", marker = "extra == 'llamaindex'", specifier = ">=0.6.0" }, + { name = "llama-index-llms-openai", marker = "extra == 'llamaindex'", specifier = ">=0.6.8" }, { name = "modal", marker = "extra == 'modal'", specifier = ">=1.5.0" }, - { name = "openai", marker = "extra == 'openai'", specifier = ">=2.45.0" }, + { name = "openai", marker = "extra == 'openai'", specifier = ">=2.47.0" }, { name = "pyarrow", marker = "python_full_version >= '3.14' and extra == 'parquet'", specifier = ">=22.0.0" }, { name = "pyarrow", marker = "python_full_version < '3.14' and extra == 'parquet'", specifier = ">=18.0.0" }, { name = "pydantic-ai-harness", extras = ["codemode"], marker = "extra == 'code-mode'", specifier = ">=0.3.0" }, { name = "pydantic-ai-shields", marker = "extra == 'shields'", specifier = ">=0.3.4" }, { name = "pydantic-ai-skills", marker = "extra == 'skills'", specifier = ">=1.2.0" }, - { name = "pydantic-ai-slim", specifier = ">=2.23.0" }, - { name = "pydantic-ai-slim", extras = ["anthropic"], marker = "extra == 'anthropic'", specifier = ">=2.23.0" }, - { name = "pydantic-ai-slim", extras = ["bedrock"], marker = "extra == 'bedrock'", specifier = ">=2.23.0" }, - { name = "pydantic-ai-slim", extras = ["google"], marker = "extra == 'google'", specifier = ">=2.23.0" }, - { name = "pydantic-ai-slim", extras = ["mcp"], marker = "extra == 'mcp'", specifier = ">=2.23.0" }, - { name = "pydantic-ai-slim", extras = ["openai"], marker = "extra == 'openai'", specifier = ">=2.23.0" }, + { name = "pydantic-ai-slim", specifier = ">=2.33.0" }, + { name = "pydantic-ai-slim", extras = ["anthropic"], marker = "extra == 'anthropic'", specifier = ">=2.33.0" }, + { name = "pydantic-ai-slim", extras = ["bedrock"], marker = "extra == 'bedrock'", specifier = ">=2.33.0" }, + { name = "pydantic-ai-slim", extras = ["google"], marker = "extra == 'google'", specifier = ">=2.33.0" }, + { name = "pydantic-ai-slim", extras = ["mcp"], marker = "extra == 'mcp'", specifier = ">=2.33.0" }, + { name = "pydantic-ai-slim", extras = ["openai"], marker = "extra == 'openai'", specifier = ">=2.33.0" }, { name = "pypdf", marker = "extra == 'pdf'", specifier = ">=4.0.0" }, { name = "python-docx", marker = "extra == 'docx'", specifier = ">=1.0.0" }, { name = "sqlglot", marker = "extra == 'sql'", specifier = ">=30.0.0" }, @@ -4738,12 +4739,12 @@ dev = [ { name = "apache-airflow-providers-standard", editable = "providers/standard" }, { name = "apache-airflow-task-sdk", editable = "task-sdk" }, { name = "langchain", specifier = ">=1.0.0" }, - { name = "llama-index-core", specifier = ">=0.13.0" }, + { name = "llama-index-core", specifier = ">=0.14.5" }, { name = "llama-index-embeddings-openai", specifier = ">=0.6.0" }, - { name = "llama-index-llms-openai", specifier = ">=0.6.0" }, - { name = "openai", specifier = ">=2.45.0" }, + { name = "llama-index-llms-openai", specifier = ">=0.6.8" }, + { name = "openai", specifier = ">=2.47.0" }, { name = "pydantic-ai-skills", specifier = ">=1.2.0" }, - { name = "pydantic-ai-slim", extras = ["mcp"], specifier = ">=2.23.0" }, + { name = "pydantic-ai-slim", extras = ["mcp"], specifier = ">=2.33.0" }, { name = "sqlglot", specifier = ">=30.0.0" }, ] docs = [{ name = "apache-airflow-devel-common", extras = ["docs"], editable = "devel-common" }] @@ -20797,22 +20798,22 @@ wheels = [ [[package]] name = "pydantic-ai-slim" -version = "2.31.1" +version = "2.44.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, { name = "genai-prices" }, { name = "griffelib" }, - { name = "httpx" }, + { name = "httpx2" }, { name = "opentelemetry-api" }, { name = "pydantic" }, { name = "pydantic-graph" }, { name = "typing-inspection" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/28/9d/a100fed1873151d930c45ed4e394647ba4d0bad5794d24d384b20dad3bad/pydantic_ai_slim-2.31.1.tar.gz", hash = "sha256:f04611e65e9a619b077732651240753cfb058bd844bd3c4e1eea549a48d38376", size = 1214403, upload-time = "2026-08-18T03:39:52.762Z" } +sdist = { url = "https://files.pythonhosted.org/packages/00/dc/563e7157b940f0274b0687e523f46f9d3ea4936e472c66c8c17b7856eb2e/pydantic_ai_slim-2.44.0.tar.gz", hash = "sha256:88be3150dc6c89383e4dd596414dda3479c2773ee6e9e40789596d82fc34a783", size = 1519519, upload-time = "2026-09-17T04:11:32.578Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e4/76/90841be18ff357a39c27d5bee5246af6bb71f13399b55ab318c4c32cc4c8/pydantic_ai_slim-2.31.1-py3-none-any.whl", hash = "sha256:4647d801c5febbd150203d130ddff6db2c481675626b648653e832f419609702", size = 1432432, upload-time = "2026-08-18T03:39:45.947Z" }, + { url = "https://files.pythonhosted.org/packages/8b/69/1acef0ae723f28ec0554cfad06fac1004b6d75ef2540ef29ff8e46688d58/pydantic_ai_slim-2.44.0-py3-none-any.whl", hash = "sha256:67063d1b2900e92dc558079fa3854e0141ed6f81ec5fb7d9c4d1b3b86bd0c9b6", size = 1800583, upload-time = "2026-09-17T04:11:23.706Z" }, ] [package.optional-dependencies] @@ -20967,18 +20968,17 @@ wheels = [ [[package]] name = "pydantic-graph" -version = "2.31.1" +version = "2.44.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, - { name = "httpx" }, { name = "logfire-api" }, { name = "pydantic" }, { name = "typing-inspection" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/2e/40/da6b9b7ee8c77b5c5e910ecc49a7d4ed93422a9bddb1726ed876b6abbeea/pydantic_graph-2.31.1.tar.gz", hash = "sha256:ac5f34e7bbf518a18a9c22f1e33418c3343542a8ea269ee8ee58e637e3f4fd56", size = 45179, upload-time = "2026-08-18T03:39:54.732Z" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/3d/22cecd0197d171cdf09e47de5e8ab906ce8b7632f282433046340564cf03/pydantic_graph-2.44.0.tar.gz", hash = "sha256:e6d62aa8579b83815b9adcb3dbff210647951ef4fa5f6526b24ee9d168d385bb", size = 45191, upload-time = "2026-09-17T04:11:35.238Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c6/40/ca98101077f17c1773c1aad617d03f6a0666936a8c6aeb4aac4c3e61eb54/pydantic_graph-2.31.1-py3-none-any.whl", hash = "sha256:7a5a9a8143d52f509a917263eeb49b4466eda6caf5131d1e71143fc6e9710157", size = 52662, upload-time = "2026-08-18T03:39:49.133Z" }, + { url = "https://files.pythonhosted.org/packages/d7/21/699faf6b87b785e15a7ebe163052ac74606a19d5275211e28bf725e17e22/pydantic_graph-2.44.0-py3-none-any.whl", hash = "sha256:7a7aec1399d8dfc09f0485c4f9749c568bc451ed517ee1f3e903c3d216ea17e5", size = 52698, upload-time = "2026-09-17T04:11:27.685Z" }, ] [[package]]