Fix(router.py): Kill a bug that forced Azure OpenAI to have an API key, even though we can use OIDC instead.

This commit is contained in:
David Manouchehri 2024-05-16 22:02:09 +00:00
parent 4952e244d9
commit 50accc327c
No known key found for this signature in database

View file

@ -2375,7 +2375,7 @@ class Router:
organization = litellm.get_secret(organization_env_name)
litellm_params["organization"] = organization
if "azure" in model_name and isinstance(api_key, str):
if "azure" in model_name:
if api_base is None or not isinstance(api_base, str):
raise ValueError(
f"api_base is required for Azure OpenAI. Set it on your config. Model - {model}"