Skip to content

Commit

Permalink
Return close statements to fix permissions on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed Nov 26, 2024
1 parent f8ba83f commit 0b5189d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions agency_swarm/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0b5189d

Please sign in to comment.