From d0a7983a41d1007bbcf1a9db9902c33031d77943 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 10 Jul 2024 17:22:14 -0700 Subject: [PATCH] fix try / except langfuse deep copy --- litellm/integrations/langfuse.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/litellm/integrations/langfuse.py b/litellm/integrations/langfuse.py index e7b2f5e0bc..a3fa1e2cee 100644 --- a/litellm/integrations/langfuse.py +++ b/litellm/integrations/langfuse.py @@ -326,7 +326,12 @@ class LangFuseLogger: or isinstance(value, int) or isinstance(value, float) ): - new_metadata[key] = copy.deepcopy(value) + try: + new_metadata[key] = copy.deepcopy(value) + except Exception as e: + verbose_logger.error( + f"Langfuse [Non-blocking error] - error copying metadata: {str(e)}" + ) metadata = new_metadata supports_tags = Version(langfuse.version.__version__) >= Version("2.6.3")