Skip to content

Commit

Permalink
adjust refresh from id logic
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed Oct 19, 2024
1 parent dc65148 commit 55a0527
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions agency_swarm/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,11 @@ def init_oai(self):
path = self.get_settings_path()

# load assistant from id
if self.id and self.refresh_from_id:
if self.id:
if not self.refresh_from_id:
return self

self.assistant = self.client.beta.assistants.retrieve(self.id)

# Assign attributes to self if they are None
self.instructions = self.instructions or self.assistant.instructions
self.name = self.name if self.name != self.__class__.__name__ else self.assistant.name
Expand Down

0 comments on commit 55a0527

Please sign in to comment.