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>
This commit is contained in:
Felix Rothe 2026-03-06 20:55:45 +01:00 committed by GitHub
parent bffc97a2ee
commit 2841df5e76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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