Skip to content

Commit ce488aa

Browse files
authored
Update processors.py
1 parent ab66578 commit ce488aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/agents/tracing/processors.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ def set_api_key(self, api_key: str):
6969
api_key: The OpenAI API key to use. This is the same key used by the OpenAI Python
7070
client.
7171
"""
72-
# We're specifically setting the underlying cached property as well
72+
# Clear the cached property if it exists
73+
if 'api_key' in self.__dict__:
74+
del self.__dict__['api_key']
75+
76+
# Update the private attribute
7377
self._api_key = api_key
74-
self.api_key = api_key
7578

7679
@cached_property
7780
def api_key(self):

0 commit comments

Comments
 (0)