Skip to content

Commit

Permalink
Reset client on setting api key
Browse files Browse the repository at this point in the history
  • Loading branch information
VRSEN committed Jan 29, 2024
1 parent 80eaadf commit 6bbd3c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions agency_swarm/util/oai.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ def set_openai_key(key):
if not key:
raise ValueError("Invalid API key. The API key cannot be empty.")
openai.api_key = key
global client
with client_lock:
client = None

0 comments on commit 6bbd3c7

Please sign in to comment.