mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
style: format bedrock guardrail hook
This commit is contained in:
parent
241c168071
commit
642bdc134f
1 changed files with 2 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue