diff --git a/litellm/llms/a2a/chat/guardrail_translation/handler.py b/litellm/llms/a2a/chat/guardrail_translation/handler.py index 3fb432efa63..8d56dbadfc3 100644 --- a/litellm/llms/a2a/chat/guardrail_translation/handler.py +++ b/litellm/llms/a2a/chat/guardrail_translation/handler.py @@ -245,8 +245,8 @@ class A2AGuardrailHandler(BaseTranslation): # Collect text from each chunk in order (by original index in responses_so_far) text_parts: List[str] = [] - chunk_indices_with_text: List[int] = [] # indices into valid_parsed - for idx, (orig_i, obj) in enumerate(valid_parsed): + chunk_indices_with_text: List[int] = [] # indices into responses_so_far + for orig_i, obj in valid_parsed: t = extract_text_from_a2a_response(obj) if t: text_parts.append(t) diff --git a/litellm/llms/anthropic/chat/guardrail_translation/handler.py b/litellm/llms/anthropic/chat/guardrail_translation/handler.py index 1c36e21de4e..81dfde35f37 100644 --- a/litellm/llms/anthropic/chat/guardrail_translation/handler.py +++ b/litellm/llms/anthropic/chat/guardrail_translation/handler.py @@ -408,6 +408,9 @@ class AnthropicMessagesHandler(BaseTranslation): inputs["model"] = response_model return inputs + # Backward-compat alias — subclasses that overrode _build_guardrail_inputs still work + _build_guardrail_inputs = _build_output_guardrail_inputs + async def process_output_streaming_response( self, responses_so_far: List[Any],