Skip to content

Commit 7e14c43

Browse files
committed
add missing refresh api key to realtime
1 parent ddddf78 commit 7e14c43

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/openai/resources/realtime/realtime.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ async def __aenter__(self) -> AsyncRealtimeConnection:
326326
raise OpenAIError("You need to install `openai[realtime]` to use this method") from exc
327327

328328
extra_query = self.__extra_query
329+
await self.__client._refresh_api_key()
329330
auth_headers = self.__client.auth_headers
330331
if is_async_azure_client(self.__client):
331332
url, auth_headers = await self.__client._configure_realtime(self.__model, extra_query)
@@ -507,6 +508,7 @@ def __enter__(self) -> RealtimeConnection:
507508
raise OpenAIError("You need to install `openai[realtime]` to use this method") from exc
508509

509510
extra_query = self.__extra_query
511+
self.__client._refresh_api_key()
510512
auth_headers = self.__client.auth_headers
511513
if is_azure_client(self.__client):
512514
url, auth_headers = self.__client._configure_realtime(self.__model, extra_query)

0 commit comments

Comments
 (0)