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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix linting errors
Ishaan Jaffc2f7d7b18516
diff --git a/enterprise/enterprise_hooks/session_handler.py b/enterprise/enterprise_hooks/session_handler.pyindex 1ac419a7a1c..94a3ccc436e 100644--- a/enterprise/enterprise_hooks/session_handler.py+++ b/enterprise/enterprise_hooks/session_handler.py@@ -11,8 +11,8 @@ from litellm.types.llms.openai import (ResponseInputParam,)from litellm.types.utils import ChatCompletionMessageToolCall-from litellm.types.responses.main import ChatCompletionSessionfrom litellm.responses.utils import ResponsesAPIRequestUtils+from litellm.responses.litellm_completion_transformation.transformation import ChatCompletionSessionclass _ENTERPRISE_ResponsesSessionHandler:diff --git a/litellm/responses/litellm_completion_transformation/transformation.py b/litellm/responses/litellm_completion_transformation/transformation.pyindex 9c9923cf29f..66cf24cefee 100644--- a/litellm/responses/litellm_completion_transformation/transformation.py+++ b/litellm/responses/litellm_completion_transformation/transformation.py@@ -7,14 +7,17 @@ from typing import Any, Dict, List, Optional, Unionfrom openai.types.responses.tool_param import FunctionToolParamfrom typing_extensions import TypedDict+HAS_ENTERPRISE_DIRECTORY = Falsetry:import enterprisefrom enterprise.enterprise_hooks.session_handler import (_ENTERPRISE_ResponsesSessionHandler,)++ HAS_ENTERPRISE_DIRECTORY = Trueexcept ImportError:- enterprise = None_ENTERPRISE_ResponsesSessionHandler = None # type: ignore+ HAS_ENTERPRISE_DIRECTORY = Falsefrom litellm.caching import InMemoryCachefrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj@@ -195,7 +198,10 @@ class LiteLLMCompletionResponsesConfig:"""Async hook to get the chain of previous input and output pairs and return a list of Chat Completion messages"""- if _ENTERPRISE_ResponsesSessionHandler and ChatCompletionSession:+ if (+ HAS_ENTERPRISE_DIRECTORY is True+ and _ENTERPRISE_ResponsesSessionHandler is not None+ ):chat_completion_session = ChatCompletionSession(messages=[], litellm_session_id=None)