From 96ae6ab4cc3500aac86cc2bea92fd64f282f852c Mon Sep 17 00:00:00 2001 From: yucheng Date: Wed, 30 Sep 2026 20:23:23 +0000 Subject: [PATCH] fix(guardrails): suppress Azure cast lint violations with cast-ok reasons Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/guardrails/guardrail_hooks/azure/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/azure/base.py b/litellm/proxy/guardrails/guardrail_hooks/azure/base.py index ab4c3d54abf..acf0e12b8e0 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/azure/base.py +++ b/litellm/proxy/guardrails/guardrail_hooks/azure/base.py @@ -139,10 +139,10 @@ class AzureGuardrailBase: responses_input: Final = data.get("input") if not isinstance(responses_input, (str, list)): return None - validated_input: Final = cast(ResponseInputParam, responses_input) + validated_input: Final = cast(ResponseInputParam, responses_input) # cast-ok: isinstance narrowed to str | list, the ResponseInputParam shape return get_last_user_message(ResponsesAPIRequestUtils.responses_input_to_chat_messages(validated_input)) messages: Final = data.get("messages") if not isinstance(messages, list): return None - return get_last_user_message(cast(list[AllMessageValues], messages)) + return get_last_user_message(cast(list[AllMessageValues], messages)) # cast-ok: isinstance narrowed to list, the message list shape