We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent df637bf commit ae682dfCopy full SHA for ae682df
eval_protocol/proxy/proxy_core/litellm.py
@@ -83,8 +83,12 @@ async def handle_chat_completion(
83
]
84
)
85
86
- # Build Langfuse metadata (tags)
+ # Build Langfuse metadata (tags + user if present)
87
+ # Convert user_id (from preprocess hook) to trace_user_id for Langfuse
88
+ user_id = metadata.pop("user_id", None) or data.get("user")
89
litellm_metadata = {"tags": tags, **metadata}
90
+ if user_id:
91
+ litellm_metadata["trace_user_id"] = user_id
92
93
langfuse_keys = config.langfuse_keys[project_id]
94
0 commit comments