From c244e5fca42b23c740d096432825e5db28596d0b Mon Sep 17 00:00:00 2001 From: "feng.tsai" Date: Thu, 3 Sep 2026 11:25:15 +0800 Subject: [PATCH] style(guardrails): drop three whitespace-only leftovers from the narrowing Three hunks in the diff carried no functional content, each in a function this PR otherwise does not touch: a blank line deleted in __init__, one added at the end of an unrelated docstring, and one deleted in _mask_content_list -- the last residue of the masking change that was split out to #39254 and reverted after E2E showed it had no effect. ruff format is satisfied either way, so none of them were required. Removing them takes the source diff from 28 hunks to 25 and leaves _mask_content_list, __init__ and the retry helper untouched. --- litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py index 26d52df4b51..c7b2204c377 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py +++ b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py @@ -287,6 +287,7 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): self.guardrail_provider = "bedrock" self.chunk_budget_chars = chunk_budget_chars self.experimental_use_latest_role_message_only = bool(kwargs.get("experimental_use_latest_role_message_only")) + # Resource-less, detect-only InvokeGuardrailChecks mode. Present `checks` # routes the guardrail to InvokeGuardrailChecks; absent => ApplyGuardrail. self.checks: dict[str, object] | None = self._normalize_checks(checks) @@ -1251,7 +1252,6 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): guardrail block on any (sub-)chunk raises immediately -- callers must not lose that signal by continuing to post the remaining chunks. - """ try: response: Final = await self._post_apply_guardrail_content_with_retry( @@ -3211,6 +3211,7 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): masking_index += 1 if item is not None: new_content.append(item) + return new_content, masking_index def _apply_masking_to_response(