Skip to content

Commit

Permalink
Use pathlib to get class folder path #52
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed Jan 30, 2024
1 parent e74c5c1 commit 4833522
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion agency_swarm/agents/agent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import inspect
import json
import os
from pathlib import Path
from typing import Dict, Union, Any, Type
from typing import List

Expand Down Expand Up @@ -459,7 +460,8 @@ def _read_instructions(self):
self.instructions = f.read()

def get_class_folder_path(self):
return os.path.abspath(os.path.dirname(inspect.getfile(self.__class__)))
return str(Path(__file__).parent.resolve())
# return os.path.abspath(os.path.dirname(inspect.getfile(self.__class__)))

def add_shared_instructions(self, instructions: str):
if self._shared_instructions is None:
Expand Down

0 comments on commit 4833522

Please sign in to comment.