diff --git a/litellm/utils.py b/litellm/utils.py index de1d9ffb4..0babe2f0b 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2452,8 +2452,16 @@ class Logging: kwargs[k] = v # this only logs streaming once, complete_streaming_response exists i.e when stream ends if langFuseLogger is None or ( - self.langfuse_public_key != langFuseLogger.public_key - and self.langfuse_secret != langFuseLogger.secret_key + ( + self.langfuse_public_key is not None + and self.langfuse_public_key + != langFuseLogger.public_key + ) + and ( + self.langfuse_public_key is not None + and self.langfuse_public_key + != langFuseLogger.public_key + ) ): langFuseLogger = LangFuseLogger( langfuse_public_key=self.langfuse_public_key,