From dd212daa1065c3b99e0beedc737c32c1d7fbfbfa Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 5 Jul 2025 18:14:43 -0700 Subject: [PATCH] fix: fix typing import --- .../guardrails/guardrail_hooks/azure/azure_prompt_shield.py | 4 +++- .../guardrails/guardrail_hooks/azure/azure_text_moderation.py | 3 ++- .../proxy/guardrails/guardrail_hooks/bedrock_guardrails.py | 4 +++- .../types/proxy/guardrails/guardrail_hooks/lakera_ai_v2.py | 4 +++- litellm/types/proxy/guardrails/guardrail_hooks/presidio.py | 4 +++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/azure/azure_prompt_shield.py b/litellm/types/proxy/guardrails/guardrail_hooks/azure/azure_prompt_shield.py index 1683b3841d..6e04bb8299 100644 --- a/litellm/types/proxy/guardrails/guardrail_hooks/azure/azure_prompt_shield.py +++ b/litellm/types/proxy/guardrails/guardrail_hooks/azure/azure_prompt_shield.py @@ -1,4 +1,6 @@ -from typing import Any, Dict, List, TypedDict +from typing import Any, Dict, List + +from typing_extensions import TypedDict from litellm.types.proxy.guardrails.guardrail_hooks.base import GuardrailConfigModel diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/azure/azure_text_moderation.py b/litellm/types/proxy/guardrails/guardrail_hooks/azure/azure_text_moderation.py index 8d339c6ded..16eebb0892 100644 --- a/litellm/types/proxy/guardrails/guardrail_hooks/azure/azure_text_moderation.py +++ b/litellm/types/proxy/guardrails/guardrail_hooks/azure/azure_text_moderation.py @@ -1,6 +1,7 @@ -from typing import Any, Dict, List, Literal, Optional, Required, TypedDict +from typing import Any, Dict, List, Literal, Optional from pydantic import BaseModel, Field +from typing_extensions import Required, TypedDict from ..base import GuardrailConfigModel from .base import AzureContentSafetyConfigModel diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py b/litellm/types/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py index 2bef70c381..5ff39930cb 100644 --- a/litellm/types/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py +++ b/litellm/types/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py @@ -1,4 +1,6 @@ -from typing import Any, Dict, List, Literal, Optional, TypedDict, Union +from typing import Any, Dict, List, Literal, Optional, Union + +from typing_extensions import TypedDict class BedrockTextContent(TypedDict, total=False): diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/lakera_ai_v2.py b/litellm/types/proxy/guardrails/guardrail_hooks/lakera_ai_v2.py index 94c385b6ce..31fea035e8 100644 --- a/litellm/types/proxy/guardrails/guardrail_hooks/lakera_ai_v2.py +++ b/litellm/types/proxy/guardrails/guardrail_hooks/lakera_ai_v2.py @@ -1,4 +1,6 @@ -from typing import Dict, List, Optional, TypedDict +from typing import Dict, List, Optional + +from typing_extensions import TypedDict from litellm.types.llms.openai import AllMessageValues diff --git a/litellm/types/proxy/guardrails/guardrail_hooks/presidio.py b/litellm/types/proxy/guardrails/guardrail_hooks/presidio.py index 2be568eed8..5e480db482 100644 --- a/litellm/types/proxy/guardrails/guardrail_hooks/presidio.py +++ b/litellm/types/proxy/guardrails/guardrail_hooks/presidio.py @@ -1,4 +1,6 @@ -from typing import Any, Dict, List, Optional, TypedDict, Union +from typing import Any, Dict, List, Optional, Union + +from typing_extensions import TypedDict from litellm.types.guardrails import PiiEntityType