diff --git a/litellm/proxy/guardrails/guardrail_hooks/azure/prompt_shield.py b/litellm/proxy/guardrails/guardrail_hooks/azure/prompt_shield.py index 5f7e04cfb8b..5f06eeb5d89 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/azure/prompt_shield.py +++ b/litellm/proxy/guardrails/guardrail_hooks/azure/prompt_shield.py @@ -134,7 +134,7 @@ class AzureContentSafetyPromptShieldGuardrail(AzureGuardrailBase, CustomGuardrai "Azure Prompt Shield: Running pre-call prompt scan, on call_type: %s", call_type, ) - new_messages: Optional[List[AllMessageValues]] = data.get("messages") + new_messages: Optional[List[AllMessageValues]] = data.get("messages") or data.get("input") if new_messages is None: verbose_proxy_logger.warning( "Azure Prompt Shield: not running guardrail. No messages in data" diff --git a/litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py b/litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py index a465c5428dd..0b15438907b 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py +++ b/litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py @@ -227,7 +227,7 @@ class AzureContentSafetyTextModerationGuardrail(AzureGuardrailBase, CustomGuardr "Azure Text Moderation: Running pre-call prompt scan, on call_type: %s", call_type, ) - new_messages: Optional[List[AllMessageValues]] = data.get("messages") + new_messages: Optional[List[AllMessageValues]] = data.get("messages") or data.get("input") if new_messages is None: verbose_proxy_logger.warning( "Azure Text Moderation: not running guardrail. No messages in data"