mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
fix(openrouter): resolve duplicate Final declaration in is_trusted_api_base
This commit is contained in:
parent
fd14a7d694
commit
5eebd21477
1 changed files with 1 additions and 2 deletions
|
|
@ -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 ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue