fix(langfuse.py): fix logging user_id in trace param on new trace creation

Closes https://github.com/BerriAI/litellm/issues/3560
This commit is contained in:
Krrish Dholakia 2024-05-10 18:25:07 -07:00
parent 30d2df8940
commit 0115c79222
2 changed files with 20 additions and 15 deletions

View file

@ -346,6 +346,7 @@ class LangFuseLogger:
"version": clean_metadata.pop(
"trace_version", clean_metadata.get("version", None)
), # If provided just version, it will applied to the trace as well, if applied a trace version it will take precedence
"user_id": user_id,
}
for key in list(
filter(lambda key: key.startswith("trace_"), clean_metadata.keys())