phidatahq / phidata

Build AI Assistants with memory, knowledge and tools.
https://docs.phidata.com
Mozilla Public License 2.0
10.4k stars 1.5k forks source link

Unable to use tools with AWS Claude #977

Open subhashnaidu opened 1 month ago

subhashnaidu commented 1 month ago

I'm trying to use Claude Sonnet hosted on AWS Bedrock. The tools that I pass in to the assistant are never used. It hallucinates function name and parameters and never actually calls any function.

This example from the cookbook modified to use the Claude assistant never calls the DuckDuckGo tool.

from phi.assistant import Assistant
from phi.llm.aws.claude import Claude
from phi.tools.duckduckgo import DuckDuckGo
from dotenv import load_dotenv

load_dotenv()

assistant = Assistant(llm=Claude(model="anthropic.claude-3-sonnet-20240229-v1:0",temperature=0.2), tools=[DuckDuckGo()], show_tool_calls=True, read_chat_history=True)
assistant.cli_app(markdown=True)
ysolanky commented 1 month ago

Hi @subhashnaidu,

Claude has recently updated the tool calling format. We will be implementing these updates on our end soon.