From 8801f71a528ea358c3171f4f175ef8208dedd52d Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Mon, 11 Sep 2023 16:28:00 -0700 Subject: [PATCH] Add support for overriding API type for Azure calls --- litellm/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/main.py b/litellm/main.py index 3d63f7e36b..03115d803f 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -178,7 +178,7 @@ def completion( logging.update_environment_variables(model=model, user=user, optional_params=optional_params, litellm_params=litellm_params) if custom_llm_provider == "azure": # azure configs - openai.api_type = "azure" + openai.api_type = get_secret("AZURE_API_TYPE") or "azure" api_base = ( api_base @@ -968,7 +968,7 @@ def embedding( logging.update_environment_variables(model=model, user="", optional_params={}, litellm_params={"force_timeout": force_timeout, "azure": azure, "litellm_call_id": litellm_call_id, "logger_fn": logger_fn}) if azure == True: # azure configs - openai.api_type = "azure" + openai.api_type = get_secret("AZURE_API_TYPE") or "azure" openai.api_base = get_secret("AZURE_API_BASE") openai.api_version = get_secret("AZURE_API_VERSION") openai.api_key = get_secret("AZURE_API_KEY")