Commit 59855b24

Robert Craigie <robert@craigie.dev>
2024-05-24 22:37:45
chore(internal): fix lint issue
1 parent 7fff7c8
Changed files (1)
src
openai
src/openai/lib/azure.py
@@ -2,7 +2,7 @@ from __future__ import annotations
 
 import os
 import inspect
-from typing import Any, Union, Mapping, TypeVar, Callable, Awaitable, overload
+from typing import Any, Union, Mapping, TypeVar, Callable, Awaitable, cast, overload
 from typing_extensions import Self, override
 
 import httpx
@@ -515,7 +515,7 @@ class AsyncAzureOpenAI(BaseAzureClient[httpx.AsyncClient, AsyncStream[Any]], Asy
             token = provider()
             if inspect.isawaitable(token):
                 token = await token
-            if not token or not isinstance(token, str):
+            if not token or not isinstance(cast(Any, token), str):
                 raise ValueError(
                     f"Expected `azure_ad_token_provider` argument to return a string but it returned {token}",
                 )