Closed ha-zhcool closed 2 months ago
I am getting the same error. The agent reads a file correctly, I can see that in his thread, but then it crashes on this error.
Traceback (most recent call last): File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/pydantic/main.py", line 759, in getattr return pydantic_extra[item]
KeyError: 'function'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/frdel/pSync/OpenProjects/AI/swarm/Mirka/QueryAnalysisAgency/agency.py", line 37, in <module>
agency.run_demo()
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/agency_swarm/agency/agency.py", line 458, in run_demo
self.get_completion_stream(message=text, event_handler=TermEventHandler, recipient_agent=recipient_agent)
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/agency_swarm/agency/agency.py", line 143, in get_completion_stream
next(gen)
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/agency_swarm/threads/thread.py", line 84, in get_completion
item = next(output)
^^^^^^^^^^^^
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/agency_swarm/agency/agency.py", line 733, in run
yield next(gen)
^^^^^^^^^
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/agency_swarm/threads/thread.py", line 65, in get_completion
self._create_run(recipient_agent, event_handler)
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/agency_swarm/threads/thread.py", line 152, in _create_run
stream.until_done()
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/openai/lib/streaming/_assistants.py", line 102, in until_done
consume_sync_iterator(self)
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/openai/_utils/_streams.py", line 6, in consume_sync_iterator
for _ in iterator:
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/openai/lib/streaming/_assistants.py", line 69, in __iter__
for item in self._iterator:
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/openai/lib/streaming/_assistants.py", line 405, in __stream__
self._emit_sse_event(event)
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/openai/lib/streaming/_assistants.py", line 368, in _emit_sse_event
self.on_tool_call_created(self._current_tool_call)
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/agency_swarm/agency/agency.py", line 407, in on_tool_call_created
str(tool_call.function))
^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/swarm/lib/python3.11/site-packages/pydantic/main.py", line 761, in __getattr__
raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}') from exc
AttributeError: 'RetrievalToolCall' object has no attribute 'function'
I am getting the same error as well. Have either of you found a solution?
Hey everyone, my apologies for the bug. It's now fixed, so please update to the latest release.
I'm facing the following issue when adding files to the agent. Files are uploaded correctly to OpenAI storage but I get the following error when asking the agent to provide a summary.