Skip to content

Commit

Permalink
Fix issue with class folder path for collab notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed Apr 29, 2024
1 parent 4ebf8a8 commit 8505647
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion agency_swarm/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,10 @@ def get_class_folder_path(self):
return os.path.abspath(os.path.dirname(self.__module__.__file__))
except AttributeError:
# If that fails, fall back to inspect
class_file = inspect.getfile(self.__class__)
try:
class_file = inspect.getfile(self.__class__)
except TypeError or OSError or AttributeError:
return "./"
return os.path.abspath(os.path.realpath(os.path.dirname(class_file)))

def add_shared_instructions(self, instructions: str):
Expand Down

0 comments on commit 8505647

Please sign in to comment.