mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-13 13:36:15 +00:00
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:
@@ -1128,7 +1128,7 @@ class ChatAnthropic(BaseChatModel):
|
|||||||
|
|
||||||
from langchain_anthropic import ChatAnthropic
|
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}
|
tool = {"type": "web_search_20250305", "name": "web_search", "max_uses": 3}
|
||||||
llm_with_tools = llm.bind_tools([tool])
|
llm_with_tools = llm.bind_tools([tool])
|
||||||
|
Binary file not shown.
@@ -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)
|
llm.bind_tools([color_picker]).invoke(messages)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.vcr
|
@pytest.mark.vcr
|
||||||
def test_web_search() -> None:
|
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}
|
tool = {"type": "web_search_20250305", "name": "web_search", "max_uses": 1}
|
||||||
llm_with_tools = llm.bind_tools([tool])
|
llm_with_tools = llm.bind_tools([tool])
|
||||||
|
Reference in New Issue
Block a user