diff --git a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py index ab987ec4c48..13c7b611e8a 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py +++ b/litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py @@ -1649,9 +1649,7 @@ class BedrockGuardrail(CustomGuardrail, BaseAWSLLM): if not content: return (tuple(content),) - lengths: Final = tuple( - len((item.get("text") or BedrockTextContent()).get("text") or "") for item in content - ) + lengths: Final = tuple(len((item.get("text") or BedrockTextContent()).get("text") or "") for item in content) def assign(carried: tuple[int, int], length: int) -> tuple[int, int]: batch_index, used = carried diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_guardrails.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_guardrails.py index 045b69dc942..42e66d823b2 100644 --- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_guardrails.py +++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_guardrails.py @@ -6,7 +6,6 @@ import asyncio import base64 import json import sys -from datetime import datetime, timezone from unittest.mock import AsyncMock, MagicMock, patch import httpx