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

from `'claude-3-5-sonnet-latest'` to `'claude-3-5-haiku-latest'` since
sonnet is deprecated
This commit is contained in:
Mason Daugherty
2025-09-10 16:44:04 -04:00
committed by GitHub
parent 0abf82a45a
commit 3da0377c02
3 changed files with 3 additions and 3 deletions

View File

@@ -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])

View File

@@ -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])