Skip to content

The agent engineering platform.

fix(anthropic): update `ChatAnthropic` model in tests/doc (#32892)

Mason Daugherty3da0377c02e1
diff --git a/libs/partners/anthropic/langchain_anthropic/chat_models.py b/libs/partners/anthropic/langchain_anthropic/chat_models.py
index b1052a1f10..11b3bc9f63 100644
--- a/libs/partners/anthropic/langchain_anthropic/chat_models.py
+++ b/libs/partners/anthropic/langchain_anthropic/chat_models.py
@@ -1128,7 +1128,7 @@ class ChatAnthropic(BaseChatModel):
from langchain_anthropic import ChatAnthropic
- llm = ChatAnthropic(model="claude-3-5-sonnet-latest")
+ llm = ChatAnthropic(model="claude-3-5-haiku-latest")
tool = {"type": "web_search_20250305", "name": "web_search", "max_uses": 3}
llm_with_tools = llm.bind_tools([tool])
diff --git a/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz b/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz
index 546cdf8c50..6802f28040 100644
Binary files a/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz and b/libs/partners/anthropic/tests/cassettes/test_web_search.yaml.gz differ
diff --git a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py b/libs/partners/anthropic/tests/integration_tests/test_chat_models.py
index 73e4be5b40..cb937155bf 100644
--- a/libs/partners/anthropic/tests/integration_tests/test_chat_models.py
+++ b/libs/partners/anthropic/tests/integration_tests/test_chat_models.py
@@ -895,13 +895,13 @@ def test_image_tool_calling() -> None:
],
),
]
- llm = ChatAnthropic(model="claude-3-5-sonnet-latest") # type: ignore[call-arg]
+ llm = ChatAnthropic(model="claude-3-5-haiku-latest") # type: ignore[call-arg]
llm.bind_tools([color_picker]).invoke(messages)
@pytest.mark.vcr
def test_web_search() -> None:
- llm = ChatAnthropic(model="claude-3-5-sonnet-latest") # type: ignore[call-arg]
+ llm = ChatAnthropic(model="claude-3-5-haiku-latest") # type: ignore[call-arg]
tool = {"type": "web_search_20250305", "name": "web_search", "max_uses": 1}
llm_with_tools = llm.bind_tools([tool])