From f3eb108f86a5b02063f35a6d2f50d69ceb57cf91 Mon Sep 17 00:00:00 2001 From: Ninad Phalak Date: Thu, 3 Sep 2026 19:41:46 -0500 Subject: [PATCH] fix(guardrails): drop Final from a loop-assigned local basedpyright rejects a Final assigned inside a loop, and reportGeneralTypeIssues sits one over its budget ceiling. --- .../proxy/guardrails/guardrail_hooks/llm_shield/llm_shield.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/llm_shield/llm_shield.py b/litellm/proxy/guardrails/guardrail_hooks/llm_shield/llm_shield.py index 26c6774f48d..172de67020b 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/llm_shield/llm_shield.py +++ b/litellm/proxy/guardrails/guardrail_hooks/llm_shield/llm_shield.py @@ -99,7 +99,7 @@ def _collect_content(container: MutableRequest, slots: _SlotSink) -> None: def _collect_tool_arguments(message: MutableRequest, slots: _SlotSink) -> None: """Tool arguments carry the values a user asked the model to act on.""" for tool_call in message.get("tool_calls") or (): - function: Final = tool_call.get("function") if isinstance(tool_call, dict) else None + function = tool_call.get("function") if isinstance(tool_call, dict) else None # rebind-ok: loop variable. if isinstance(function, dict): _collect(function, "arguments", slots) legacy: Final = message.get("function_call")