From 0dc8b08987d25a3ec2ac5b29c63cf5287f3b319d Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Wed, 4 Mar 2026 10:35:56 -0300 Subject: [PATCH 1/2] fix: remove unused top-level EncryptedContentAffinityCheck import The class is already imported locally where it's used (line 1261). Co-Authored-By: Claude Opus 4.6 --- litellm/router.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index 3760f93b620..8d44882cdf8 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -115,9 +115,6 @@ from litellm.router_utils.handle_error import ( from litellm.router_utils.pre_call_checks.deployment_affinity_check import ( DeploymentAffinityCheck, ) -from litellm.router_utils.pre_call_checks.encrypted_content_affinity_check import ( - EncryptedContentAffinityCheck, -) from litellm.router_utils.pre_call_checks.model_rate_limit_check import ( ModelRateLimitingCheck, ) From f0cd93aeb229258724a09b4547fdcf3eeb270969 Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Wed, 4 Mar 2026 10:47:47 -0300 Subject: [PATCH 2/2] fix: remove unused imports in tool_management_endpoints and streaming_iterator - Remove unused ToolOutputPolicy import - Remove unused _WsClientConnection TYPE_CHECKING import Co-Authored-By: Claude Opus 4.6 --- .../proxy/management_endpoints/tool_management_endpoints.py | 1 - litellm/responses/streaming_iterator.py | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/litellm/proxy/management_endpoints/tool_management_endpoints.py b/litellm/proxy/management_endpoints/tool_management_endpoints.py index 7fdd3475c04..19ca2c9f6be 100644 --- a/litellm/proxy/management_endpoints/tool_management_endpoints.py +++ b/litellm/proxy/management_endpoints/tool_management_endpoints.py @@ -26,7 +26,6 @@ from litellm.types.tool_management import ( ToolDetailResponse, ToolInputPolicy, ToolListResponse, - ToolOutputPolicy, ToolPolicyOption, ToolPolicyOptionsResponse, ToolPolicyUpdateRequest, diff --git a/litellm/responses/streaming_iterator.py b/litellm/responses/streaming_iterator.py index 09d770b0fac..0af5c467126 100644 --- a/litellm/responses/streaming_iterator.py +++ b/litellm/responses/streaming_iterator.py @@ -3,7 +3,7 @@ import json import time import traceback from datetime import datetime -from typing import TYPE_CHECKING, Any, Dict, List, Optional +from typing import Any, Dict, List, Optional import httpx @@ -688,9 +688,6 @@ class MockResponsesAPIStreamingIterator(BaseResponsesAPIStreamingIterator): # WebSocket mode streaming (bidirectional forwarding) # --------------------------------------------------------------------------- -if TYPE_CHECKING: - from websockets.asyncio.client import ClientConnection as _WsClientConnection - from litellm._logging import verbose_logger from litellm.litellm_core_utils.thread_pool_executor import executor as _ws_executor