style: format bedrock guardrail hook

This commit is contained in:
aiedwardyi 2026-08-26 18:35:23 +09:00
parent 241c168071
commit 642bdc134f
No known key found for this signature in database

View file

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