From 8c6a19d3abbe00a47b2db0bd8662a5e4380cc782 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 29 May 2024 18:40:53 -0700 Subject: [PATCH] fix put litellm prefix in generation name --- litellm/integrations/langfuse.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/litellm/integrations/langfuse.py b/litellm/integrations/langfuse.py index 977db62d31..12b20f3d31 100644 --- a/litellm/integrations/langfuse.py +++ b/litellm/integrations/langfuse.py @@ -459,10 +459,9 @@ class LangFuseLogger: # If using litellm proxy user `key_alias` if not None # If `key_alias` is None, just log `litellm-{call_type}` as the generation name _user_api_key_alias = clean_metadata.get("user_api_key_alias", None) - generation_name = ( - _user_api_key_alias - or f"litellm-{kwargs.get('call_type', 'completion')}" - ) + generation_name = f"litellm-{kwargs.get('call_type', 'completion')}" + if _user_api_key_alias is not None: + generation_name = f"litellm:{_user_api_key_alias}" if response_obj is not None and "system_fingerprint" in response_obj: system_fingerprint = response_obj.get("system_fingerprint", None)