From 5eebd214778c21e04af93d376e9feff17f3857a3 Mon Sep 17 00:00:00 2001 From: musi22 Date: Mon, 21 Sep 2026 12:55:36 +0530 Subject: [PATCH] fix(openrouter): resolve duplicate Final declaration in is_trusted_api_base --- litellm/llms/openrouter/text_to_speech/transformation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/litellm/llms/openrouter/text_to_speech/transformation.py b/litellm/llms/openrouter/text_to_speech/transformation.py index 0d85ae17a81..c481cc7a49e 100644 --- a/litellm/llms/openrouter/text_to_speech/transformation.py +++ b/litellm/llms/openrouter/text_to_speech/transformation.py @@ -44,16 +44,15 @@ class OpenrouterTextToSpeechConfig(BaseTextToSpeechConfig): def is_trusted_api_base(self, api_base: str | None) -> bool: if not api_base: return True + configured_base: Final = get_secret_str("OPENROUTER_API_BASE") or litellm.api_base parsed: Final = urlparse(api_base) scheme: Final = parsed.scheme.lower() if scheme != "https": - configured_base: Final = get_secret_str("OPENROUTER_API_BASE") or litellm.api_base return bool( configured_base is not None and api_base.rstrip("/") == configured_base.rstrip("/") and parsed.hostname in ("localhost", "127.0.0.1") ) - configured_base: Final = get_secret_str("OPENROUTER_API_BASE") or litellm.api_base if configured_base is not None and api_base.rstrip("/") == configured_base.rstrip("/"): return True hostname: Final = parsed.hostname or ""