From 4e5e7395595950355d9f1836ef9dfe92a3b52884 Mon Sep 17 00:00:00 2001 From: harish876 Date: Fri, 10 Apr 2026 23:11:54 +0000 Subject: [PATCH] resolve dependency cycle --- .../file_content_streaming_handler.py | 3 ++- litellm/proxy/openai_files_endpoints/files_endpoints.py | 8 +++++--- .../proxy/openai_files_endpoint/test_files_endpoint.py | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) rename litellm/{files => proxy/openai_files_endpoints}/file_content_streaming_handler.py (99%) diff --git a/litellm/files/file_content_streaming_handler.py b/litellm/proxy/openai_files_endpoints/file_content_streaming_handler.py similarity index 99% rename from litellm/files/file_content_streaming_handler.py rename to litellm/proxy/openai_files_endpoints/file_content_streaming_handler.py index dd39e1b0312..b22077e8c12 100644 --- a/litellm/files/file_content_streaming_handler.py +++ b/litellm/proxy/openai_files_endpoints/file_content_streaming_handler.py @@ -6,10 +6,11 @@ import litellm from litellm.files.types import FileContentStreamingResult from litellm.proxy._types import UserAPIKeyAuth from litellm.proxy.common_request_processing import ProxyBaseLLMRequestProcessing +from litellm.proxy.utils import ProxyLogging + from litellm.proxy.openai_files_endpoints.common_utils import ( prepare_data_with_credentials, ) -from litellm.proxy.utils import ProxyLogging class FileContentStreamingHandler: diff --git a/litellm/proxy/openai_files_endpoints/files_endpoints.py b/litellm/proxy/openai_files_endpoints/files_endpoints.py index eefcd12ddbb..fb131f33ec3 100644 --- a/litellm/proxy/openai_files_endpoints/files_endpoints.py +++ b/litellm/proxy/openai_files_endpoints/files_endpoints.py @@ -24,7 +24,7 @@ from fastapi import ( import litellm from litellm import CreateFileRequest, get_secret_str from litellm._logging import verbose_proxy_logger -from litellm.files.file_content_streaming_handler import ( +from litellm.proxy.openai_files_endpoints.file_content_streaming_handler import ( FileContentStreamingHandler, ) from litellm.llms.base_llm.files.transformation import BaseFileEndpoints @@ -49,14 +49,16 @@ from litellm.types.llms.openai import ( OpenAIFilesPurpose, ) -from .common_utils import ( +from litellm.proxy.openai_files_endpoints.common_utils import ( _is_base64_encoded_unified_file_id, encode_file_id_with_model, extract_file_creation_params, get_credentials_for_model, handle_model_based_routing, ) -from .storage_backend_service import StorageBackendFileService +from litellm.proxy.openai_files_endpoints.storage_backend_service import ( + StorageBackendFileService, +) router = APIRouter() diff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py index 47bcaa2dfc5..476b57d9f3b 100644 --- a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py +++ b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py @@ -14,11 +14,13 @@ sys.path.insert( import litellm from litellm import Router -from litellm.files.file_content_streaming_handler import FileContentStreamingHandler from litellm.files.types import FileContentStreamingResult from litellm.proxy._types import LiteLLM_UserTableFiltered, UserAPIKeyAuth from litellm.proxy.hooks import get_proxy_hook from litellm.proxy.management_endpoints.internal_user_endpoints import ui_view_users +from litellm.proxy.openai_files_endpoints.file_content_streaming_handler import ( + FileContentStreamingHandler, +) from litellm.proxy.proxy_server import app from litellm.types.llms.openai import OpenAIFileObject