From 18e16f907f9e6bd81650b34c547ed7a925d77aaf Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 27 Nov 2025 22:22:54 +0530 Subject: [PATCH] fix main lint error --- litellm/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/main.py b/litellm/main.py index 7855ff099be..1936101ef92 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -1693,6 +1693,11 @@ def completion( # type: ignore # noqa: PLR0915 if "claude" in model_lower: # Use Azure Anthropic handler for Claude models api_base = AzureFoundryModelInfo.get_api_base(api_base) + if api_base is None: + raise ValueError( + "Azure Anthropic requests require an api_base. " + "Set `api_base` or the AZURE_AI_API_BASE env var." + ) api_key = AzureFoundryModelInfo.get_api_key(api_key) # Ensure the URL ends with /v1/messages for Anthropic