mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
feat(redact_messages.py): allow remove sensitive key information before passing to logging integration
This commit is contained in:
parent
0b9e93d863
commit
548e4f53f8
7 changed files with 65 additions and 4 deletions
|
@ -8,6 +8,7 @@ from packaging.version import Version
|
|||
|
||||
import litellm
|
||||
from litellm._logging import verbose_logger
|
||||
from litellm.litellm_core_utils.redact_messages import redact_user_api_key_info
|
||||
|
||||
|
||||
class LangFuseLogger:
|
||||
|
@ -382,6 +383,8 @@ class LangFuseLogger:
|
|||
mask_input = clean_metadata.pop("mask_input", False)
|
||||
mask_output = clean_metadata.pop("mask_output", False)
|
||||
|
||||
clean_metadata = redact_user_api_key_info(metadata=clean_metadata)
|
||||
|
||||
if trace_name is None and existing_trace_id is None:
|
||||
# just log `litellm-{call_type}` as the trace name
|
||||
## DO NOT SET TRACE_NAME if trace-id set. this can lead to overwriting of past traces.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue