fix: move BasePassthroughLoggingHandler imports to local scope to avoid cyclic import warnings

This commit is contained in:
Dawid Łaziński 2026-04-20 20:12:05 +02:00
parent c6f77aa964
commit 7e6f4f3306
No known key found for this signature in database
3 changed files with 7 additions and 8 deletions

View file

@ -19,7 +19,6 @@ from litellm.types.passthrough_endpoints.pass_through_endpoints import (
)
from litellm.types.utils import LiteLLMBatch, ModelResponse, TextCompletionResponse
from .base_passthrough_logging_handler import BasePassthroughLoggingHandler
if TYPE_CHECKING:
from litellm.types.passthrough_endpoints.pass_through_endpoints import EndpointType
@ -159,6 +158,7 @@ class AnthropicPassthroughLoggingHandler:
{"proxy_server_request": {"body": {"user": user}}}
)
from .base_passthrough_logging_handler import BasePassthroughLoggingHandler # noqa: PLC0415
BasePassthroughLoggingHandler._apply_spend_logs_metadata(
kwargs, passthrough_logging_payload
)
@ -227,12 +227,11 @@ class AnthropicPassthroughLoggingHandler:
"result": None,
"kwargs": {},
}
from .base_passthrough_logging_handler import BasePassthroughLoggingHandler # noqa: PLC0415
kwargs = AnthropicPassthroughLoggingHandler._create_anthropic_response_logging_payload(
litellm_model_response=complete_streaming_response,
model=model,
kwargs=BasePassthroughLoggingHandler._seed_streaming_kwargs_from_logging_obj(
litellm_logging_obj
),
kwargs=BasePassthroughLoggingHandler._seed_streaming_kwargs_from_logging_obj(litellm_logging_obj),
start_time=start_time,
end_time=end_time,
logging_obj=litellm_logging_obj,

View file

@ -17,7 +17,6 @@ from litellm.types.utils import (
TextCompletionResponse,
)
from .base_passthrough_logging_handler import BasePassthroughLoggingHandler
if TYPE_CHECKING:
from litellm.types.passthrough_endpoints.pass_through_endpoints import EndpointType
@ -141,6 +140,7 @@ class GeminiPassthroughLoggingHandler:
- Creates standard logging object
- Logs in litellm callbacks
"""
from .base_passthrough_logging_handler import BasePassthroughLoggingHandler # noqa: PLC0415
kwargs: Dict[str, Any] = (
BasePassthroughLoggingHandler._seed_streaming_kwargs_from_logging_obj(
litellm_logging_obj
@ -248,6 +248,7 @@ class GeminiPassthroughLoggingHandler:
kwargs["model"] = model
kwargs["custom_llm_provider"] = custom_llm_provider
from .base_passthrough_logging_handler import BasePassthroughLoggingHandler # noqa: PLC0415
BasePassthroughLoggingHandler._apply_spend_logs_metadata(
kwargs, kwargs.get("passthrough_logging_payload")
)

View file

@ -16,9 +16,6 @@ from litellm.llms.vertex_ai.vector_stores.search_api.transformation import (
)
from litellm.llms.vertex_ai.videos.transformation import VertexAIVideoConfig
from litellm.proxy._types import PassThroughEndpointLoggingTypedDict
from litellm.proxy.pass_through_endpoints.llm_provider_handlers.base_passthrough_logging_handler import (
BasePassthroughLoggingHandler,
)
from litellm.types.utils import (
Choices,
EmbeddingResponse,
@ -344,6 +341,7 @@ class VertexPassthroughLoggingHandler:
- Creates standard logging object
- Logs in litellm callbacks
"""
from litellm.proxy.pass_through_endpoints.llm_provider_handlers.base_passthrough_logging_handler import BasePassthroughLoggingHandler # noqa: PLC0415
kwargs: Dict[str, Any] = (
BasePassthroughLoggingHandler._seed_streaming_kwargs_from_logging_obj(
litellm_logging_obj
@ -554,6 +552,7 @@ class VertexPassthroughLoggingHandler:
kwargs["response_cost"] = response_cost
kwargs["model"] = model
from litellm.proxy.pass_through_endpoints.llm_provider_handlers.base_passthrough_logging_handler import BasePassthroughLoggingHandler # noqa: PLC0415
BasePassthroughLoggingHandler._apply_spend_logs_metadata(
kwargs, kwargs.get("passthrough_logging_payload")
)