From 642bdc134f6a9908700c9c4fdceeda5d0c2c7a17 Mon Sep 17 00:00:00 2001 From: aiedwardyi <41576951+aiedwardyi@users.noreply.github.com> Date: Wed, 26 Aug 2026 18:35:23 +0900 Subject: [PATCH] style: format bedrock guardrail hook --- .../guardrails/guardrail_hooks/bedrock_guardrails.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py index cc25b6ee56f..03e03a5d536 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py +++ b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py @@ -779,8 +779,7 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): ): return [] if not any( - isinstance(deployment, Mapping) - and (deployment.get("model_info") or {}).get("allow_fail_open") is True + isinstance(deployment, Mapping) and (deployment.get("model_info") or {}).get("allow_fail_open") is True for deployment in deployments ): return [] @@ -888,11 +887,7 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): if isinstance(deployment, Mapping) else getattr(deployment, "litellm_params", None) ) - return ( - params.get(weight_by) - if isinstance(params, Mapping) - else getattr(params, weight_by, None) - ) + return params.get(weight_by) if isinstance(params, Mapping) else getattr(params, weight_by, None) for weight_by in ("weight", "rpm", "tpm"): first_weight: Final[object | None] = _weight(deployments[0], weight_by)