I am trying to create a simple custom function and calling from agent as part of tools getting below error:
PS C:\learn\HuggingFace> python .\OCI_IAM_AI_LLAMA.py
DEBUG Debug logs enabled
DEBUG *********** Agent Run Start: ed586dc7-16cc-477c-9956-ce17e1def0b3 ***********
DEBUG Function sum added to model.
DEBUG ---------- HuggingFace Response Start ----------
DEBUG ============== system ==============
DEBUG ## Instructions
Use markdown to format your answers.
DEBUG ============== user ==============
DEBUG calculate the sum of 2 and 4
▰▱▱▱▱▱▱ Thinking…
┏━ Message ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃
┃ calculate the sum of 2 and 4 ┃
┃ ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Traceback (most recent call last):
File “C:\learn\HuggingFace\OCI_IAM_AI_LLAMA.py”, line 41, in
agent.print_response(“calculate the sum of 2 and 4”,stream=True)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\phi\agent\agent.py”, line 2783, in print_response
for resp in self.run(message=message, messages=messages, stream=True, **kwargs):
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\phi\agent\agent.py”, line 1794, in _run
for model_response_chunk in self.model.response_stream(messages=messages_for_model):
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\phi\model\huggingface\hf.py”, line 736, in response_stream
_tool_calls = self._build_tool_calls(stream_data.response_tool_calls)
File “C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\phi\model\huggingface\hf.py”, line 826, in _build_tool_calls
_tool_call_id = _tool_call.id
^^^^^^^^^^^^^
AttributeError: ‘str’ object has no attribute ‘id’