From 2841df5e76309bce4fcdefa71f7461be36d46ae2 Mon Sep 17 00:00:00 2001 From: Felix Rothe Date: Fri, 6 Mar 2026 20:55:45 +0100 Subject: [PATCH] Fix LITELLM_USE_CHAT_COMPLETIONS_URL_FOR_ANTHROPIC_MESSAGES always truthy when set to any non-empty string Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- litellm/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/litellm/__init__.py b/litellm/__init__.py index 60971f6d8c2..c9b4599edb5 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -202,9 +202,9 @@ telemetry = True max_tokens: int = DEFAULT_MAX_TOKENS # OpenAI Defaults drop_params = os.getenv("LITELLM_DROP_PARAMS", "").lower() in ("1", "true", "yes", "on") modify_params = os.getenv("LITELLM_MODIFY_PARAMS", "").lower() in ("1", "true", "yes", "on") -use_chat_completions_url_for_anthropic_messages: bool = bool( - os.getenv("LITELLM_USE_CHAT_COMPLETIONS_URL_FOR_ANTHROPIC_MESSAGES", False) -) # When True, routes OpenAI /v1/messages requests to chat/completions instead of the Responses API +use_chat_completions_url_for_anthropic_messages: bool = ( + os.getenv("LITELLM_USE_CHAT_COMPLETIONS_URL_FOR_ANTHROPIC_MESSAGES", "").lower() in ("1", "true", "yes", "on") +) retry = True ### AUTH ### api_key: Optional[str] = None