From d6ba50319cb28d854bc65a442966013db4249739 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 4 Jun 2024 21:33:51 -0700 Subject: [PATCH] fix langfuse log metadata --- litellm/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index 3b2a69810..bb59012d2 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1310,9 +1310,13 @@ class Logging: verbose_logger.info(f"\033[92m{curl_command}\033[0m\n") # check if user wants the raw request logged to their logging provider (like LangFuse) - _litellm_params = self.model_call_details.get("litellm_params", {}) - _metadata = _litellm_params.get("metadata", {}) or {} - _metadata["raw_request"] = curl_command + try: + # [Non-blocking Extra Debug Information in metadata] + _litellm_params = self.model_call_details.get("litellm_params", {}) + _metadata = _litellm_params.get("metadata", {}) or {} + _metadata["raw_request"] = str(curl_command) + except: + pass if self.logger_fn and callable(self.logger_fn): try: