forked from phoenix/litellm-mirror
(test) langfuse
This commit is contained in:
parent
127f25703a
commit
3c8603f148
2 changed files with 4 additions and 2 deletions
|
@ -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:
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue