Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

remove custom adapter for anthropic (#7963)

Shahmir Varqha6820ce7cfa2b
diff --git a/marimo/_server/ai/providers.py b/marimo/_server/ai/providers.py
index 2436228a81..4869109003 100644
--- a/marimo/_server/ai/providers.py
+++ b/marimo/_server/ai/providers.py
@@ -792,8 +792,11 @@ class AnthropicProvider(PydanticProvider["PydanticAnthropic"]):
from ThinkingPart to ReasoningEndChunk, which breaks Anthropic's extended thinking
on follow-up messages (Anthropic requires signatures on thinking blocks).
- TODO: Remove this once https://github.com/pydantic/pydantic-ai/pull/3754 is released
+ This is a patch for pydantic-ai <1.47.0, which doesn't include the signature in the ReasoningEndChunk.
"""
+ if DependencyManager.pydantic_ai.has_at_version(min_version="1.47.0"):
+ return super().get_vercel_adapter()
+
from pydantic_ai import DeferredToolRequests
from pydantic_ai.ui.vercel_ai import VercelAIAdapter
from pydantic_ai.ui.vercel_ai._event_stream import VercelAIEventStream
diff --git a/pixi.lock b/pixi.lock
index 0912bcea3e..892b0468d6 100644
--- a/pixi.lock
+++ b/pixi.lock
@@ -118,7 +118,7 @@ environments:
- pypi: https://files.pythonhosted.org/packages/3d/2e/cf2ffeb386ac3763526151163ad7da9f1b586aac96d2b4f7de1eaebf0c61/narwhals-2.15.0-py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/16/32/f8e3c85d1d5250232a5d3477a2a28cc291968ff175caeadaf3cc19ce0e4a/parso-0.8.5-py2.py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/29/f8/40e01c350ad9a2b3cb4e6adbcc8a83b17ee50dd5792102b6142385937db5/psutil-7.2.1-cp36-abi3-manylinux2010_x86_64.manylinux_2_12_x86_64.manylinux_2_28_x86_64.whl
- - pypi: https://files.pythonhosted.org/packages/ea/10/47caf89cbb52e5bb764696fd52a8c591a2f0e851a93270c05a17f36000b5/pymdown_extensions-10.20-py3-none-any.whl
+ - pypi: https://files.pythonhosted.org/packages/40/6d/b6ee155462a0156b94312bdd82d2b92ea56e909740045a87ccb98bf52405/pymdown_extensions-10.20.1-py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/81/0d/13d1d239a25cbfb19e740db83143e95c772a1fe10202dda4b76792b114dd/starlette-0.52.1-py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/3d/d8/2083a1daa7439a66f3a48589a57d576aa117726762618f6bb09fe3798796/uvicorn-0.40.0-py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/18/29/71729b4671f21e1eaa5d6573031ab810ad2936c8175f03f97f3ff164c802/websockets-16.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
@@ -216,7 +216,7 @@ environments:
- pypi: https://files.pythonhosted.org/packages/3d/2e/cf2ffeb386ac3763526151163ad7da9f1b586aac96d2b4f7de1eaebf0c61/narwhals-2.15.0-py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/16/32/f8e3c85d1d5250232a5d3477a2a28cc291968ff175caeadaf3cc19ce0e4a/parso-0.8.5-py2.py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/c5/2c/78e4a789306a92ade5000da4f5de3255202c534acdadc3aac7b5458fadef/psutil-7.2.1-cp36-abi3-macosx_11_0_arm64.whl
- - pypi: https://files.pythonhosted.org/packages/ea/10/47caf89cbb52e5bb764696fd52a8c591a2f0e851a93270c05a17f36000b5/pymdown_extensions-10.20-py3-none-any.whl
+ - pypi: https://files.pythonhosted.org/packages/40/6d/b6ee155462a0156b94312bdd82d2b92ea56e909740045a87ccb98bf52405/pymdown_extensions-10.20.1-py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/81/0d/13d1d239a25cbfb19e740db83143e95c772a1fe10202dda4b76792b114dd/starlette-0.52.1-py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/3d/d8/2083a1daa7439a66f3a48589a57d576aa117726762618f6bb09fe3798796/uvicorn-0.40.0-py3-none-any.whl
- pypi: https://files.pythonhosted.org/packages/40/1e/9771421ac2286eaab95b8575b0cb701ae3663abf8b5e1f64f1fd90d0a673/websockets-16.0-cp312-cp312-macosx_11_0_arm64.whl
@@ -1132,8 +1132,8 @@ packages:
timestamp: 1727801725384
- pypi: ./
name: marimo
- version: 0.19.4
- sha256: 8d121008dd6aa452b389d1132e1e5876c0aa09505840255a9b1987f19700d309
+ version: 0.19.6
+ sha256: cb0d06cbaea0049a0732ad93980bdc55f82636fa8464aa560fc3c94d628cacb5
requires_dist:
- click>=8.0,<9
- jedi>=0.18.0
@@ -1169,6 +1169,7 @@ packages:
- mcp>=1.0.0 ; extra == 'mcp'
- pydantic>2 ; extra == 'mcp'
requires_python: '>=3.10'
+ editable: true
- pypi: https://files.pythonhosted.org/packages/59/1b/6ef961f543593969d25b2afe57a3564200280528caa9bd1082eecdd7b3bc/markdown-3.10.1-py3-none-any.whl
name: markdown
version: 3.10.1
@@ -1593,10 +1594,10 @@ packages:
- pkg:pypi/pygments?source=hash-mapping
size: 889287
timestamp: 1750615908735
-- pypi: https://files.pythonhosted.org/packages/ea/10/47caf89cbb52e5bb764696fd52a8c591a2f0e851a93270c05a17f36000b5/pymdown_extensions-10.20-py3-none-any.whl
+- pypi: https://files.pythonhosted.org/packages/40/6d/b6ee155462a0156b94312bdd82d2b92ea56e909740045a87ccb98bf52405/pymdown_extensions-10.20.1-py3-none-any.whl
name: pymdown-extensions
- version: '10.20'
- sha256: ea9e62add865da80a271d00bfa1c0fa085b20d133fb3fc97afdc88e682f60b2f
+ version: 10.20.1
+ sha256: 24af7feacbca56504b313b7b418c4f5e1317bb5fea60f03d57be7fcc40912aa0
requires_dist:
- markdown>=3.6
- pyyaml
diff --git a/pyproject.toml b/pyproject.toml
index ca3feda84a..fb6d58e3d2 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -129,7 +129,7 @@ dev = [
# For linting
"ruff>=0.13.2",
# For AI
- "pydantic-ai-slim[openai]>=1.39.0",
+ "pydantic-ai-slim[openai]>=1.47.0",
]
test = [
@@ -186,7 +186,7 @@ test-optional = [
"anywidget~=0.9.18",
"ipython~=8.12.3",
# testing gen ai
- "pydantic-ai-slim[google,anthropic,bedrock,openai]>=1.39.0",
+ "pydantic-ai-slim[google,anthropic,bedrock,openai]>=1.47.0",
# - google-auth uses cachetools, and cachetools<5.0.0 uses collections.MutableMapping (removed in Python 3.10)
"cachetools>=5.0.0",
"boto3>=1.38.46",
@@ -244,7 +244,7 @@ dependencies = [
"matplotlib>=3.8.0",
"sqlglot[rs]>=26.2.0",
"sqlalchemy>=2.0.40",
- "pydantic-ai-slim[google,anthropic,bedrock,openai]>=1.39.0",
+ "pydantic-ai-slim[google,anthropic,bedrock,openai]>=1.47.0",
"loro>=1.5.0",
"pandas-stubs>=1.5.3.230321",
"pyiceberg>=0.9.0",