Hello Community. I was trying to develop an agent, which creates a comprehensive knowledge base about topic given and put the content in a Google Doc. The Agent is expected to create a Google doc with knowledge base it generated.
I am using Meta-Llama-3-8B-Instruct LLM available in HuggingFace and Composio for tools. Unfortunately, I am getting the below error
“AttributeError: ‘ChatCompletionOutputToolCall’ object has no attribute 'model_dump”’
It worked fine, when I tried to print response without giving tools parameter to agent. When I gave tools and asked Agent to create google doc, this error is displayed
Can anyone solve this issue please ? I think there is a coordination issue between HuggingFace model and tools
Attaching script for reference,
from phi.agent import Agent, RunResponse
from phi.model.huggingface import HuggingFaceChat
from composio_phidata import Action,ComposioToolSet
composio_toolset = ComposioToolSet(api_key=“—UPDATEDINTENTIONALLY—”)
tools = composio_toolset.get_tools(actions=[‘GOOGLEDOCS_CREATE_DOCUMENT’])
import os
os.environ[‘HF_TOKEN’] = “—UPDATEDINTENTIONALLY—”
professor_agent = Agent(
name = “Professor Agent”,
role = “Research and Knowledge specialist”,
model = HuggingFaceChat(
id = “meta-llama/Meta-Llama-3-8B-Instruct”,
max_tokens = 4096
),
instructions = [
“Create a comprehensive knowledge base that covers fundamental concepts, advanced topics, and current developments of the given topic.”,
“Exlain the topic from first principles first. Include key terminology, core principles, and practical applications and make it as a detailed report that anyone who’s starting out can read and get maximum value out of it.”,
“Make sure it is formatted in a way that is easy to read and understand.”,
“Create a Google Docs document, place the knowledge base created in the document with nice formatting”
],
tools = tools,
markdown= True,
debug_mode=True
)
from phi.utils.pprint import pprint_run_response
response : RunResponse = professor_agent.run("The topic is ‘Machine Learning’ ")
pprint_run_response(response)