Skip to content

Commit

Permalink
Improved error handling for existing threads
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed Aug 13, 2024
1 parent a32329f commit c24be1c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions agency_swarm/threads/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ def create_message(self, message: str, role: str = "user", attachments: List[dic
thread_id=f"thread_{thread_id}",
run_id=f"run_{run_id}"
)
self.run = self.client.beta.threads.runs.poll(
thread_id=self.id,
run_id=self.run.id,
poll_interval_ms=500,
)
return self.client.beta.threads.messages.create(
thread_id=self.id,
role=role,
Expand Down

0 comments on commit c24be1c

Please sign in to comment.