Skip to content

Commit

Permalink
Fix conditions to avoid token fetch in completions
Browse files Browse the repository at this point in the history
  • Loading branch information
lossyrob committed Sep 25, 2024
1 parent 4bd5758 commit 002ab11
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ def __init__(

# If the api_key is none, and the ad_token is none, and the ad_token_provider is none,
# then we will attempt to get the ad_token using the default endpoint specified in the Azure OpenAI settings.
if api_key is None and ad_token_provider is None and azure_openai_settings.token_endpoint and ad_token is None:
if (
azure_openai_settings.api_key is None
and ad_token_provider is None
and azure_openai_settings.token_endpoint
and ad_token is None
and async_client is None
):
ad_token = azure_openai_settings.get_azure_openai_auth_token(
token_endpoint=azure_openai_settings.token_endpoint
)
Expand Down

0 comments on commit 002ab11

Please sign in to comment.