mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 07:09:31 +00:00
update test
This commit is contained in:
parent
8662fd8c7d
commit
c8d96ad346
@ -547,6 +547,30 @@ def test_get_num_tokens_from_messages() -> None:
|
|||||||
"""Get weather report for a city"""
|
"""Get weather report for a city"""
|
||||||
return "Sunny"
|
return "Sunny"
|
||||||
|
|
||||||
|
messages = [
|
||||||
|
HumanMessage(content="What is the weather in SF?"),
|
||||||
|
AIMessage(
|
||||||
|
content=[
|
||||||
|
{"text": "Let's see.", "type": "text"},
|
||||||
|
{
|
||||||
|
"id": "toolu_01V6d6W32QGGSmQm4BT98EKk",
|
||||||
|
"input": {"location": "SF"},
|
||||||
|
"name": "get_weather",
|
||||||
|
"type": "tool_use",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tool_calls=[
|
||||||
|
{
|
||||||
|
"name": "get_weather",
|
||||||
|
"args": {"location": "SF"},
|
||||||
|
"id": "toolu_01V6d6W32QGGSmQm4BT98EKk",
|
||||||
|
"type": "tool_call",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
),
|
||||||
|
ToolMessage(content="Sunny", tool_call_id="toolu_01V6d6W32QGGSmQm4BT98EKk"),
|
||||||
|
]
|
||||||
|
|
||||||
## via init
|
## via init
|
||||||
formatted_tool = convert_to_anthropic_tool(get_weather)
|
formatted_tool = convert_to_anthropic_tool(get_weather)
|
||||||
llm = ChatAnthropic(
|
llm = ChatAnthropic(
|
||||||
|
Loading…
Reference in New Issue
Block a user