diff --git a/litellm/completion_extras/litellm_responses_transformation/transformation.py b/litellm/completion_extras/litellm_responses_transformation/transformation.py index 216c06f1354..6f2819ce902 100644 --- a/litellm/completion_extras/litellm_responses_transformation/transformation.py +++ b/litellm/completion_extras/litellm_responses_transformation/transformation.py @@ -26,6 +26,7 @@ from pydantic import BaseModel import litellm from litellm import ModelResponse from litellm._logging import verbose_logger +from litellm.litellm_core_utils.streaming_handler import CustomStreamWrapper from litellm.llms.base_llm.base_model_iterator import BaseModelResponseIterator from litellm.llms.base_llm.bridges.completion_transformation import ( CompletionTransformationBridge, @@ -39,7 +40,6 @@ from litellm.types.llms.openai import ( ResponsesAPIStreamEvents, ) from litellm.types.utils import GenericStreamingChunk, ModelResponseStream -from litellm.utils import CustomStreamWrapper if TYPE_CHECKING: from openai.types.responses import ResponseInputImageParam diff --git a/tests/test_litellm/proxy/prompts/test_prompt_endpoints.py b/tests/test_litellm/proxy/prompts/test_prompt_endpoints.py index 6c2e5fa7667..b5b9c7b2b82 100644 --- a/tests/test_litellm/proxy/prompts/test_prompt_endpoints.py +++ b/tests/test_litellm/proxy/prompts/test_prompt_endpoints.py @@ -248,7 +248,9 @@ class TestPromptVersionsEndpoint: } # Mock the IN_MEMORY_PROMPT_REGISTRY at the import location - with patch("litellm.proxy.prompts.prompt_registry.IN_MEMORY_PROMPT_REGISTRY") as mock_registry: + with patch( + "litellm.proxy.prompts.prompt_registry.IN_MEMORY_PROMPT_REGISTRY" + ) as mock_registry, patch("litellm.proxy.proxy_server.prisma_client", None): mock_registry.IN_MEMORY_PROMPTS = mock_prompts # Test with base prompt ID @@ -293,7 +295,9 @@ class TestPromptVersionsEndpoint: user_role=LitellmUserRoles.PROXY_ADMIN ) - with patch("litellm.proxy.prompts.prompt_registry.IN_MEMORY_PROMPT_REGISTRY") as mock_registry: + with patch( + "litellm.proxy.prompts.prompt_registry.IN_MEMORY_PROMPT_REGISTRY" + ) as mock_registry, patch("litellm.proxy.proxy_server.prisma_client", None): mock_registry.IN_MEMORY_PROMPTS = {} with pytest.raises(HTTPException) as exc_info: @@ -304,4 +308,3 @@ class TestPromptVersionsEndpoint: assert exc_info.value.status_code == 404 assert "No versions found" in exc_info.value.detail -