'ChatAnthropic' object has no attribute 'bind_functions' #25487
Replies: 1 comment
-
Hey @imandal98-ai! I'm here to assist you with any bugs, questions, or contributions. Let's tackle this issue together while we wait for a human maintainer. To resolve the error Here is an example of how to use the from langchain_anthropic import ChatAnthropic
from langchain_core.pydantic_v1 import BaseModel, Field
class GetWeather(BaseModel):
'''Get the current weather in a given location'''
location: str = Field(..., description="The city and state, e.g. San Francisco, CA")
class GetPrice(BaseModel):
'''Get the price of a specific product.'''
product: str = Field(..., description="The product to look up.")
llm = ChatAnthropic(model="claude-3-opus-20240229", temperature=0)
llm_with_tools = llm.bind_tools([GetWeather, GetPrice])
llm_with_tools.invoke("what is the weather like in San Francisco") Using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I attempted to run the same code provided in the link using a different LLM model: llm=ChatAnthropic(model='claude-3-opus-20240229'). However, it resulted in an error stating, 'ChatAnthropic' object has no attribute 'bind_function'.
System Info
Package Information
Beta Was this translation helpful? Give feedback.
All reactions