From 682f338c17811b74d51d87397adcc6edac080d9d Mon Sep 17 00:00:00 2001 From: ccurme Date: Wed, 7 May 2025 18:04:06 -0400 Subject: [PATCH] anthropic[patch]: support web search (#31157) --- .../anthropic/langchain_anthropic/chat_models.py | 1 + libs/partners/anthropic/pyproject.toml | 2 +- libs/partners/anthropic/uv.lock | 11 +++++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/partners/anthropic/langchain_anthropic/chat_models.py b/libs/partners/anthropic/langchain_anthropic/chat_models.py index 122f523e9e3..26c6a7f39b5 100644 --- a/libs/partners/anthropic/langchain_anthropic/chat_models.py +++ b/libs/partners/anthropic/langchain_anthropic/chat_models.py @@ -99,6 +99,7 @@ def _is_builtin_tool(tool: Any) -> bool: "text_editor_", "computer_", "bash_", + "web_search_", ] return any(tool_type.startswith(prefix) for prefix in _builtin_tool_prefixes) diff --git a/libs/partners/anthropic/pyproject.toml b/libs/partners/anthropic/pyproject.toml index 5adf54d6809..b4d4d5f71a8 100644 --- a/libs/partners/anthropic/pyproject.toml +++ b/libs/partners/anthropic/pyproject.toml @@ -7,7 +7,7 @@ authors = [] license = { text = "MIT" } requires-python = ">=3.9" dependencies = [ - "anthropic<1,>=0.49.0", + "anthropic<1,>=0.51.0", "langchain-core<1.0.0,>=0.3.53", "pydantic<3.0.0,>=2.7.4", ] diff --git a/libs/partners/anthropic/uv.lock b/libs/partners/anthropic/uv.lock index 59e060f0de4..d1ea2f5b65a 100644 --- a/libs/partners/anthropic/uv.lock +++ b/libs/partners/anthropic/uv.lock @@ -1,5 +1,4 @@ version = 1 -revision = 1 requires-python = ">=3.9" resolution-markers = [ "python_full_version >= '3.13'", @@ -19,7 +18,7 @@ wheels = [ [[package]] name = "anthropic" -version = "0.49.0" +version = "0.51.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -30,9 +29,9 @@ dependencies = [ { name = "sniffio" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/86/e3/a88c8494ce4d1a88252b9e053607e885f9b14d0a32273d47b727cbee4228/anthropic-0.49.0.tar.gz", hash = "sha256:c09e885b0f674b9119b4f296d8508907f6cff0009bc20d5cf6b35936c40b4398", size = 210016 } +sdist = { url = "https://files.pythonhosted.org/packages/63/4a/96f99a61ae299f9e5aa3e765d7342d95ab2e2ba5b69a3ffedb00ef779651/anthropic-0.51.0.tar.gz", hash = "sha256:6f824451277992af079554430d5b2c8ff5bc059cc2c968cdc3f06824437da201", size = 219063 } wheels = [ - { url = "https://files.pythonhosted.org/packages/76/74/5d90ad14d55fbe3f9c474fdcb6e34b4bed99e3be8efac98734a5ddce88c1/anthropic-0.49.0-py3-none-any.whl", hash = "sha256:bbc17ad4e7094988d2fa86b87753ded8dce12498f4b85fe5810f208f454a8375", size = 243368 }, + { url = "https://files.pythonhosted.org/packages/8c/6e/9637122c5f007103bd5a259f4250bd8f1533dd2473227670fd10a1457b62/anthropic-0.51.0-py3-none-any.whl", hash = "sha256:b8b47d482c9aa1f81b923555cebb687c2730309a20d01be554730c8302e0f62a", size = 263957 }, ] [[package]] @@ -452,7 +451,7 @@ typing = [ [package.metadata] requires-dist = [ - { name = "anthropic", specifier = ">=0.49.0,<1" }, + { name = "anthropic", specifier = ">=0.51.0,<1" }, { name = "langchain-core", editable = "../../core" }, { name = "pydantic", specifier = ">=2.7.4,<3.0.0" }, ] @@ -487,7 +486,7 @@ typing = [ [[package]] name = "langchain-core" -version = "0.3.56" +version = "0.3.59" source = { editable = "../../core" } dependencies = [ { name = "jsonpatch" },