You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to execute a demo example using Hugging face Inference API using phidata tools
though I change to any model I get following error
[/usr/local/lib/python3.10/dist-packages/phi/agent/agent.py](https://localhost:8080/#) in print_response(self, message, messages, stream, markdown, show_message, show_reasoning, show_full_reasoning, console, **kwargs)
2810 live_log.update(Group(*panels))
2811
-> 2812 for resp in self.run(message=message, messages=messages, stream=True, **kwargs):
2813 if isinstance(resp, RunResponse) and isinstance(resp.content, str):
2814 if resp.event == RunEvent.run_response:
[/usr/local/lib/python3.10/dist-packages/phi/agent/agent.py](https://localhost:8080/#) in _run(self, message, stream, audio, images, videos, messages, stream_intermediate_steps, **kwargs)
1804 if self.stream:
1805 model_response = ModelResponse(content="")
-> 1806 for model_response_chunk in self.model.response_stream(messages=messages_for_model):
1807 if model_response_chunk.event == ModelResponseEvent.assistant_response.value:
1808 if model_response_chunk.content is not None and model_response.content is not None:
[/usr/local/lib/python3.10/dist-packages/phi/model/huggingface/hf.py](https://localhost:8080/#) in response_stream(self, messages)
734
735 if stream_data.response_tool_calls is not None:
--> 736 _tool_calls = self._build_tool_calls(stream_data.response_tool_calls)
737 if len(_tool_calls) > 0:
738 assistant_message.tool_calls = _tool_calls
[/usr/local/lib/python3.10/dist-packages/phi/model/huggingface/hf.py](https://localhost:8080/#) in _build_tool_calls(self, tool_calls_data)
824 for _tool_call in tool_calls_data:
825 _index = _tool_call.index
--> 826 _tool_call_id = _tool_call.id
827 _tool_call_type = _tool_call.type
828 _function_name = _tool_call.function.name if _tool_call.function else None
AttributeError: 'str' object has no attribute 'id'
This is my sample agent
from phi.agent import Agent
from phi.model.huggingface import HuggingFaceChat
from phi.tools.duckduckgo import DuckDuckGo
import os
web_agent = Agent(
name="Web Agent",
model=HuggingFaceChat(
id="meta-llama/Meta-Llama-3-8B-Instruct",
max_tokens=4096,
),
tools=[DuckDuckGo()],
instructions=["Always include sources"],
show_tool_calls=True,
markdown=True,
)
web_agent.print_response("Whats happening in France?", stream=True)
The text was updated successfully, but these errors were encountered:
Hello @nagendragillalu I was able to replicate this issue with HuggingFaceChat. Our HuggingFaceChat model class requires an update and I am on it. Sharing updates soon!
I am trying to execute a demo example using Hugging face Inference API using phidata tools
though I change to any model I get following error
This is my sample agent
The text was updated successfully, but these errors were encountered: