diff --git a/litellm/tests/test_langfuse.py b/litellm/tests/test_langfuse.py index 07db7553e..01e411fb4 100644 --- a/litellm/tests/test_langfuse.py +++ b/litellm/tests/test_langfuse.py @@ -34,6 +34,7 @@ def search_logs(log_file_path): try: with open(log_file_path, 'r') as log_file: lines = log_file.readlines() + print(f"searching logslines: {lines}") for line in lines: all_logs.append(line.strip()) if "/api/public" in line: @@ -94,7 +95,7 @@ def test_langfuse_logging_async(): response = asyncio.run(_test_langfuse()) print(f"response: {response}") - time.sleep(5) + time.sleep(2) # check langfuse.log to see if there was a failed response search_logs("langfuse.log") except litellm.Timeout as e: diff --git a/litellm/utils.py b/litellm/utils.py index 2b23d6a78..6a9669db8 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -959,7 +959,8 @@ class Logging: else: print_verbose("reaches langfuse for streaming logging!") result = kwargs["complete_streaming_response"] - + if langFuseLogger is None: + langFuseLogger = LangFuseLogger() langFuseLogger.log_event( kwargs=kwargs, response_obj=result,