mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
fix(proxy): satisfy type-discipline gates in guard middleware
LIT001: declare the mutable-ok suppression for the conditionally assembled config kwargs. LIT003: give the availability-probe noqa a reason.
This commit is contained in:
parent
dcb4d9e7ef
commit
df88b920c4
2 changed files with 2 additions and 2 deletions
|
|
@ -76,7 +76,7 @@ def _build_guard_config() -> SecurityConfig:
|
|||
"""Build the SecurityConfig from the LITELLM_GUARD_* environment variables."""
|
||||
from guard import SecurityConfig
|
||||
|
||||
kwargs: dict[str, object] = {
|
||||
kwargs: dict[str, object] = { # mutable-ok: assembled conditionally, then passed once to SecurityConfig
|
||||
"enable_rate_limiting": True,
|
||||
"rate_limit": _env_int("LITELLM_GUARD_RATE_LIMIT", 100),
|
||||
"rate_limit_window": _env_int("LITELLM_GUARD_RATE_LIMIT_WINDOW", 60),
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from litellm.proxy.middleware.guard_middleware import (
|
|||
_IP = itertools.count(1)
|
||||
|
||||
try:
|
||||
import guard # noqa: F401
|
||||
import guard # noqa: F401 # availability probe for skip logic
|
||||
|
||||
_GUARD_AVAILABLE = True
|
||||
except ImportError:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue