From 2165dcf6fbce2f92e1d4744613c0d4375e57c8f3 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sun, 21 Jan 2024 00:56:30 -0800 Subject: [PATCH] fix(utils.py): fix callback logging --- litellm/utils.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index d67f9e1db3..c690f7cc4e 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1090,13 +1090,7 @@ class Logging: verbose_logger.debug(f"success callbacks: {litellm.success_callback}") ## BUILD COMPLETE STREAMED RESPONSE complete_streaming_response = None - if ( - self.stream - and self.model_call_details.get("litellm_params", {}).get( - "acompletion", False - ) - == False - ): # only call stream chunk builder if it's not acompletion() + if self.stream: if ( result.choices[0].finish_reason is not None ): # if it's the last chunk @@ -1113,6 +1107,9 @@ class Logging: self.streaming_chunks.append(result) if complete_streaming_response: + verbose_logger.info( + f"Logging Details LiteLLM-Success Call streaming complete" + ) self.model_call_details[ "complete_streaming_response" ] = complete_streaming_response @@ -1255,7 +1252,7 @@ class Logging: verbose_logger.debug( f"is complete_streaming_response in kwargs: {kwargs.get('complete_streaming_response', None)}" ) - if "complete_streaming_response" not in kwargs: + if complete_streaming_response is None: break else: print_verbose("reaches langfuse for streaming logging!")