mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
fix: backward compat for CustomLogger.redact_standard_logging_payload_from_model_call_details subclasses
This commit is contained in:
parent
941d89cd9f
commit
2cc860f3f6
1 changed files with 10 additions and 5 deletions
|
|
@ -2514,11 +2514,16 @@ class Logging(LiteLLMLoggingBaseClass):
|
|||
if isinstance(callback, CustomLogger): # custom logger class
|
||||
model_call_details: Dict = self.model_call_details
|
||||
##################################
|
||||
# call redaction hook for custom logger
|
||||
model_call_details = callback.redact_standard_logging_payload_from_model_call_details(
|
||||
model_call_details=model_call_details,
|
||||
global_redaction_applied=global_redaction_applied,
|
||||
)
|
||||
# call redaction hook for custom logger (backward compat: subclasses may only accept model_call_details)
|
||||
try:
|
||||
model_call_details = callback.redact_standard_logging_payload_from_model_call_details(
|
||||
model_call_details=model_call_details,
|
||||
global_redaction_applied=global_redaction_applied,
|
||||
)
|
||||
except TypeError:
|
||||
model_call_details = callback.redact_standard_logging_payload_from_model_call_details(
|
||||
model_call_details=model_call_details,
|
||||
)
|
||||
##################################
|
||||
if self.stream is True:
|
||||
if "async_complete_streaming_response" in model_call_details:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue