forked from phoenix/litellm-mirror
Merge pull request #1857 from BerriAI/litellm_improve_logging_langfuse_cache_hits
[FEAT] show langfuse logging / cache tags better through proxy
This commit is contained in:
commit
8119f547ef
1 changed files with 7 additions and 1 deletions
|
@ -252,8 +252,14 @@ class LangFuseLogger:
|
||||||
print_verbose(f"trace: {cost}")
|
print_verbose(f"trace: {cost}")
|
||||||
if supports_tags:
|
if supports_tags:
|
||||||
for key, value in metadata.items():
|
for key, value in metadata.items():
|
||||||
|
if key in [
|
||||||
|
"user_api_key",
|
||||||
|
"user_api_key_user_id",
|
||||||
|
]:
|
||||||
tags.append(f"{key}:{value}")
|
tags.append(f"{key}:{value}")
|
||||||
if "cache_hit" in kwargs:
|
if "cache_hit" in kwargs:
|
||||||
|
if kwargs["cache_hit"] is None:
|
||||||
|
kwargs["cache_hit"] = False
|
||||||
tags.append(f"cache_hit:{kwargs['cache_hit']}")
|
tags.append(f"cache_hit:{kwargs['cache_hit']}")
|
||||||
trace_params.update({"tags": tags})
|
trace_params.update({"tags": tags})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue