(test) langfuse

This commit is contained in:
ishaan-jaff 2023-12-09 22:44:02 -08:00
parent 127f25703a
commit 3c8603f148
2 changed files with 4 additions and 2 deletions

View file

@ -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:

View file

@ -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,