Skip to content

Official Anthropic function calling support?Β #65

@austinmw

Description

@austinmw

Anthropic announced GA support for tools today (5/30): https://www.anthropic.com/news/tool-use-ga

Is this meant to be supported? I saw some PRs mentioned related to tool use, but the following code returns an empty list:

from langchain_aws import ChatBedrock  # langchain-aws v0.1.4 (latest)
from langchain_core.messages import HumanMessage
from langchain_community.tools import DuckDuckGoSearchRun

llm = ChatBedrock(
    model_id="anthropic.claude-3-sonnet-20240229-v1:0",
    region_name="us-east-1",
)

search = DuckDuckGoSearchRun()

tools = [search]

# llm with tools
llm_with_tools = llm.bind_tools(tools)

messages = [
    ("system", "You are a helpful assistant."),
    ("human", "What is LangChain Tool Calling?")
]

llm_with_tools.invoke(messages).tool_calls

Output:

[]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions