From 717d1dd14c67dced150e35977037886ab974833d Mon Sep 17 00:00:00 2001 From: AlphaRex-pixel Date: Mon, 12 Oct 2026 23:05:50 +0530 Subject: [PATCH] Fix import ordering in TealTiger guardrail --- .../guardrails/guardrail_hooks/tealtiger/tealtiger.py | 7 ++++--- .../proxy/guardrails/guardrail_hooks/test_tealtiger.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/litellm/proxy/guardrails/guardrail_hooks/tealtiger/tealtiger.py b/litellm/proxy/guardrails/guardrail_hooks/tealtiger/tealtiger.py index b7a4851f7a1..45f45b1f912 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/tealtiger/tealtiger.py +++ b/litellm/proxy/guardrails/guardrail_hooks/tealtiger/tealtiger.py @@ -14,24 +14,25 @@ from collections.abc import Mapping, Sequence from typing import TYPE_CHECKING, Final, Literal from fastapi import HTTPException + from litellm._logging import verbose_proxy_logger from litellm.integrations.custom_guardrail import ( CustomGuardrail, log_guardrail_information, # pyright: ignore[reportUnknownVariableType] # upstream decorator is untyped ) from litellm.types.guardrails import GuardrailEventHooks, Mode -from litellm.types.utils import GenericGuardrailAPIInputs - from litellm.types.proxy.guardrails.guardrail_hooks.tealtiger import DEFAULT_POLICIES, Policy, PolicyMode +from litellm.types.utils import GenericGuardrailAPIInputs from .decision import NO_VIOLATIONS, Action, Decision from .engine import TealEngine from .request import identity_of, tool_name_of if TYPE_CHECKING: + from pydantic import BaseModel + from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj from litellm.types.proxy.guardrails.guardrail_hooks.base import GuardrailConfigModel - from pydantic import BaseModel def _to_event_hook( diff --git a/tests/unit/proxy/guardrails/guardrail_hooks/test_tealtiger.py b/tests/unit/proxy/guardrails/guardrail_hooks/test_tealtiger.py index e991b8fa2a1..aaf564b3c8c 100644 --- a/tests/unit/proxy/guardrails/guardrail_hooks/test_tealtiger.py +++ b/tests/unit/proxy/guardrails/guardrail_hooks/test_tealtiger.py @@ -6,7 +6,6 @@ from unittest.mock import patch import pytest from fastapi import HTTPException -from litellm.types.guardrails import GuardrailEventHooks from pydantic import ValidationError from litellm.proxy.guardrails.guardrail_hooks.tealtiger import budget as budget_module @@ -21,6 +20,7 @@ from litellm.proxy.guardrails.guardrail_hooks.tealtiger.request import ( tool_name_of, ) from litellm.proxy.guardrails.guardrail_hooks.tealtiger.tealtiger import TealTigerGuardrail, _to_event_hook +from litellm.types.guardrails import GuardrailEventHooks from litellm.types.proxy.guardrails.guardrail_hooks.tealtiger import ( DEFAULT_POLICIES, CostPolicy,