Merge pull request #3706 from Manouchehri/fix-azure-openai-3695

Fix(router.py): Kill a bug that forced Azure OpenAI to have an API ke…
This commit is contained in:
Ishaan Jaff 2024-05-16 17:44:48 -07:00 committed by GitHub
commit fdc9690537
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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}"