Merge pull request #3391 from BerriAI/litellm_fix_langfuse_errant_prints

[Fix + Test] Errant prints on langfuse
This commit is contained in:
Ishaan Jaff 2024-05-01 19:16:49 -07:00 • committed by GitHub
commit 5870d2663d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -7,7 +7,7 @@ repos:
rev: 7.0.0 # The version of flake8 to use
hooks:
- id: flake8
exclude: ^litellm/tests/|^litellm/proxy/proxy_cli.py|^litellm/integrations/|^litellm/proxy/tests/
exclude: ^litellm/tests/|^litellm/proxy/proxy_cli.py|^litellm/proxy/tests/
additional_dependencies: [flake8-print]
files: litellm/.*\.py
- repo: local

View file

@ -111,7 +111,7 @@ class LangFuseLogger:
pass
# end of processing langfuse ########################
print(f"response obj type: {type(response_obj)}")
print_verbose(f"response obj type: {type(response_obj)}")
if (
level == "ERROR"
and status_message is not None
@ -144,7 +144,7 @@ class LangFuseLogger:
trace_id = None
generation_id = None
if self._is_langfuse_v2():
print("INSIDE V2 LANGFUSE")
print_verbose("INSIDE V2 LANGFUSE")
trace_id, generation_id = self._log_langfuse_v2(
user_id,
metadata,
@ -373,7 +373,7 @@ class LangFuseLogger:
print_verbose(f"trace_params: {trace_params}")
print(f"trace_params: {trace_params}")
print_verbose(f"trace_params: {trace_params}")
trace = self.Langfuse.trace(**trace_params)
generation_id = None
@ -427,7 +427,7 @@ class LangFuseLogger:
generation_client = trace.generation(**generation_params)
print(f"LANGFUSE TRACE ID - {generation_client.trace_id}")
print_verbose(f"LANGFUSE TRACE ID - {generation_client.trace_id}")
return generation_client.trace_id, generation_id
except Exception as e:
verbose_logger.debug(f"Langfuse Layer Error - {traceback.format_exc()}")