From 712f89b4f129cc5941cb826366fbddf7deb0477d Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 6 Jan 2024 17:02:50 +0530 Subject: [PATCH] fix(utils.py): handle original_response being a json --- litellm/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/utils.py b/litellm/utils.py index 8f93fb620d..b258b473a1 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -956,6 +956,8 @@ class Logging: ): # Log the exact result from the LLM API, for streaming - log the type of response received litellm.error_logs["POST_CALL"] = locals() + if isinstance(original_response, dict): + original_response = json.dumps(original_response) try: self.model_call_details["input"] = input self.model_call_details["api_key"] = api_key