diff --git a/dist/app-1.0.0-py3-none-any.whl b/dist/app-1.0.0-py3-none-any.whl index 949ae6a..2605859 100644 Binary files a/dist/app-1.0.0-py3-none-any.whl and b/dist/app-1.0.0-py3-none-any.whl differ diff --git a/dist/app-1.0.0.tar.gz b/dist/app-1.0.0.tar.gz index c867cab..fdbadcd 100644 Binary files a/dist/app-1.0.0.tar.gz and b/dist/app-1.0.0.tar.gz differ diff --git a/src/app/agent.py b/src/app/agent.py index 0b3e2ef..c843afa 100644 --- a/src/app/agent.py +++ b/src/app/agent.py @@ -77,7 +77,7 @@ class Agent: async def register_tool_handler(self, name, method): self.tool_handlers[name] = method - + async def dalle2( self, prompt: str, width: Optional[int] = 512, height: Optional[int] = 512 ) -> dict: @@ -152,16 +152,11 @@ class Agent: for tool in run.required_action.submit_tool_outputs.tool_calls: tool_handler = self.tool_handlers[tool.name] output = await tool_handler(tool.arguments) - outputs.append(dict( - tool_call_id=tool.id, - output=output - )) + outputs.append({"tool_call_id": tool.id, "output": output}) if outputs: run = client.beta.threads.runs.submit_tool_outputs_and_poll( - thread_id=self.thread.id, - run_id=run.id, - tool_outputs=outputs - ) + thread_id=self.thread.id, run_id=run.id, tool_outputs=outputs + ) run = self.client.beta.threads.runs.retrieve( thread_id=self.thread.id, run_id=run.id )