From e4cd222fd9e5418d139746fbfa7f54b1c179d5ab Mon Sep 17 00:00:00 2001 From: STiFLeR7 Date: Tue, 13 Oct 2026 12:41:16 +0530 Subject: [PATCH] fix(a2a): type _scan's part parameter as _A2ATextPart, not dict[str, Any] basedpyright's reportArgumentType flagged _scan (called with elements of Sequence[_A2ATextPart]) still typed to accept dict[str, Any], a stricter mismatch than the sibling _scan_input_part, which is called with real dict[str, Any] parts and had no such mismatch. Matching the real element type also clears 3 cascading reportUnknownArgumentType/ reportUnknownVariableType errors downstream of the call. --- litellm/llms/a2a/chat/guardrail_translation/handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/a2a/chat/guardrail_translation/handler.py b/litellm/llms/a2a/chat/guardrail_translation/handler.py index 8728b9db7a1..7b132c30e00 100644 --- a/litellm/llms/a2a/chat/guardrail_translation/handler.py +++ b/litellm/llms/a2a/chat/guardrail_translation/handler.py @@ -444,7 +444,7 @@ class A2AGuardrailHandler(BaseTranslation): if depth >= max_depth: return () - def _scan(part_idx: int, part: dict[str, Any]) -> tuple[tuple[str, tuple[str, ...], int, str], ...]: + def _scan(part_idx: int, part: _A2ATextPart) -> tuple[tuple[str, tuple[str, ...], int, str], ...]: kind: Final = part.get("kind") if kind == "text": text: Final = part.get("text", "")