From dc9e8bdaf77b8618115d4f530ad261212fa226f6 Mon Sep 17 00:00:00 2001 From: Lucas Garcia <32649703+Garcluca@users.noreply.github.com> Date: Fri, 16 Feb 2024 22:02:32 +0545 Subject: [PATCH] Resolving depprecated OpenAI API endpoint This variable caused the program to throw error relating to invalid requests using the OpenAI API. The variable was unused and is commented out. I ran the following command in the home directory using wsl and my opening key as an environmental variable when the error occurred. `python3 -m agents.tool_maker.unit_manager` I'm using this code as a starter for my own project which was working yesterday, commenting out this api call out fixed it. --- agents/agent_builder/create.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/agent_builder/create.py b/agents/agent_builder/create.py index 4b5d7e8..c97122d 100644 --- a/agents/agent_builder/create.py +++ b/agents/agent_builder/create.py @@ -136,7 +136,7 @@ def create_assistant(self, agent_name): create_params['file_ids'] = list(map(lambda x: x['id'], files)) # Create the assistant using the uploaded file IDs if files exist - assistant = self.client.beta.assistants.create(**create_params) + #assistant = self.client.beta.assistants.update(**update_params) print("***********************************************") def create_assistants(self): @@ -161,4 +161,4 @@ def create_assistants(self): if __name__ == '__main__': client = get_openai_client() agent_builder = AgentBuilder(client=client) - agent_builder.create_assistants() \ No newline at end of file + agent_builder.create_assistants()