Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix order of imports

Ishaan Jaffddb819da4583
diff --git a/litellm/llms/base_llm/responses/transformation.py b/litellm/llms/base_llm/responses/transformation.py
index bca8e3c7ed5..6e27fd7a542 100644
--- a/litellm/llms/base_llm/responses/transformation.py
+++ b/litellm/llms/base_llm/responses/transformation.py
@@ -14,14 +14,16 @@ from litellm.types.llms.openai import (
from litellm.types.router import GenericLiteLLMParams
from litellm.types.utils import ModelInfo
-from ..chat.transformation import BaseLLMException
-
if TYPE_CHECKING:
from litellm.litellm_core_utils.litellm_logging import Logging as _LiteLLMLoggingObj
+ from ..chat.transformation import BaseLLMException as _BaseLLMException
+
LiteLLMLoggingObj = _LiteLLMLoggingObj
+ BaseLLMException = _BaseLLMException
else:
LiteLLMLoggingObj = Any
+ BaseLLMException = Any
class BaseResponsesAPIConfig(ABC):
@@ -123,6 +125,8 @@ class BaseResponsesAPIConfig(ABC):
def get_error_class(
self, error_message: str, status_code: int, headers: Union[dict, httpx.Headers]
) -> BaseLLMException:
+ from ..chat.transformation import BaseLLMException
+
raise BaseLLMException(
status_code=status_code,
message=error_message,