From c6d6ffd567055acde3247bcaa6d00a8adb59b9f8 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Sat, 27 Dec 2025 07:28:16 +0900 Subject: [PATCH] fix: mypy error --- litellm/integrations/custom_guardrail.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/integrations/custom_guardrail.py b/litellm/integrations/custom_guardrail.py index 7bc02bb3bb..6a76b57e7f 100644 --- a/litellm/integrations/custom_guardrail.py +++ b/litellm/integrations/custom_guardrail.py @@ -516,12 +516,13 @@ class CustomGuardrail(CustomLogger): from litellm.types.utils import GuardrailMode # Use event_type if provided, otherwise fall back to self.event_hook + guardrail_mode: Union[GuardrailEventHooks, GuardrailMode, List[GuardrailEventHooks]] if event_type is not None: guardrail_mode = event_type elif isinstance(self.event_hook, Mode): - guardrail_mode = GuardrailMode(**self.event_hook.model_dump()) + guardrail_mode = GuardrailMode(**dict(self.event_hook.model_dump())) # type: ignore[typeddict-item] else: - guardrail_mode = self.event_hook + guardrail_mode = self.event_hook # type: ignore[assignment] slg = StandardLoggingGuardrailInformation( guardrail_name=self.guardrail_name,