From 0294e1119ecfda33682251aa6bec50ec0a5e61b2 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Sat, 9 Dec 2023 11:38:42 -0800 Subject: [PATCH] (fix) success_handler / logging --- litellm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index c6d855fd1..4a18fa852 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -824,7 +824,7 @@ class Logging: print_verbose(f"success callbacks: {litellm.success_callback}") ## BUILD COMPLETE STREAMED RESPONSE complete_streaming_response = None - if self.model_call_details.get("litellm_params", {}).get("acompletion", False) == True: + if self.stream == True and self.model_call_details.get("litellm_params", {}).get("acompletion", False) == True: # if it's acompletion == True, chunks are built/appended in async_success_handler if result.choices[0].finish_reason is not None: # if it's the last chunk complete_streaming_response = litellm.stream_chunk_builder(self.streaming_chunks, messages=self.model_call_details.get("messages", None))