From 0b5189d5a8426f69710d8695e0706b50baf73f41 Mon Sep 17 00:00:00 2001 From: Arsenii Shatokhin Date: Tue, 26 Nov 2024 18:07:40 +0400 Subject: [PATCH] Return close statements to fix permissions on windows --- agency_swarm/agents/agent.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/agency_swarm/agents/agent.py b/agency_swarm/agents/agent.py index 6fd5a4d6..b8edbdb9 100644 --- a/agency_swarm/agents/agent.py +++ b/agency_swarm/agents/agent.py @@ -366,6 +366,7 @@ def get_id_from_file(f_path): file_id = self.client.with_options( timeout=80 * 1000, ).files.create(file=f, purpose="assistants").id + f.close() # fix permission error on windows add_id_to_file(f_path, file_id) if file_ext in code_interpreter_file_extensions: @@ -453,6 +454,7 @@ def _parse_schemas(self): for f_path in f_paths: with open(f_path, 'r') as f: openapi_spec = f.read() + f.close() # fix permission error on windows try: validate_openapi_spec(openapi_spec) except Exception as e: