From 75b7ae2dccfe84092e4020db13b572d8fea7e69c Mon Sep 17 00:00:00 2001 From: Anuj Hydrabadi Date: Fri, 12 Sep 2025 14:24:36 +0530 Subject: [PATCH 1/2] Bug fix: _refresh_api_key not being invoked in case of Callable api key in azure openai --- src/openai/lib/azure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openai/lib/azure.py b/src/openai/lib/azure.py index ad64707261..cadce6d9ab 100644 --- a/src/openai/lib/azure.py +++ b/src/openai/lib/azure.py @@ -336,7 +336,7 @@ def _prepare_options(self, options: FinalRequestOptions) -> FinalRequestOptions: # should never be hit raise ValueError("Unable to handle auth") - return options + return super()._prepare_options(options) def _configure_realtime(self, model: str, extra_query: Query) -> tuple[httpx.URL, dict[str, str]]: auth_headers = {} @@ -619,7 +619,7 @@ async def _prepare_options(self, options: FinalRequestOptions) -> FinalRequestOp # should never be hit raise ValueError("Unable to handle auth") - return options + return super()._prepare_options(options) async def _configure_realtime(self, model: str, extra_query: Query) -> tuple[httpx.URL, dict[str, str]]: auth_headers = {} From 4f69d6cb440a140b8efb7759f64da16a0a92112e Mon Sep 17 00:00:00 2001 From: Anuj Hydrabadi Date: Fri, 12 Sep 2025 14:41:25 +0530 Subject: [PATCH 2/2] add await to async --- src/openai/lib/azure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openai/lib/azure.py b/src/openai/lib/azure.py index cadce6d9ab..3959f84140 100644 --- a/src/openai/lib/azure.py +++ b/src/openai/lib/azure.py @@ -619,7 +619,7 @@ async def _prepare_options(self, options: FinalRequestOptions) -> FinalRequestOp # should never be hit raise ValueError("Unable to handle auth") - return super()._prepare_options(options) + return await super()._prepare_options(options) async def _configure_realtime(self, model: str, extra_query: Query) -> tuple[httpx.URL, dict[str, str]]: auth_headers = {}