diff --git a/litellm/proxy/pass_through_endpoints/success_handler.py b/litellm/proxy/pass_through_endpoints/success_handler.py index 59d853a3df8..7141bf1d156 100644 --- a/litellm/proxy/pass_through_endpoints/success_handler.py +++ b/litellm/proxy/pass_through_endpoints/success_handler.py @@ -61,7 +61,7 @@ class PassThroughEndpointLogging: self.transcribe_passthrough_logging_handler: Final = ( transcribe_handler if transcribe_handler is not None else TranscribePassthroughLoggingHandler() ) - self._log_dispatch: Final = log_dispatch if log_dispatch is not None else self._handle_logging + self._injected_log_dispatch: Final = log_dispatch self.TRACKED_VERTEX_METHOD_ROUTES = ( "generateContent", "streamGenerateContent", @@ -103,6 +103,10 @@ class PassThroughEndpointLogging: # Vertex AI Live API WebSocket self.TRACKED_VERTEX_AI_LIVE_ROUTES = ["/vertex_ai/live"] + @property + def _log_dispatch(self) -> PassThroughLogDispatch: + return self._injected_log_dispatch if self._injected_log_dispatch is not None else self._handle_logging + async def _handle_logging( self, logging_obj: LiteLLMLoggingObj,