Skip to content

Commit 48619f2

Browse files
fix(litellm_logging.py): support emitting raw response on self.litellm_request_debug is true
Addresses #13814
1 parent d89152b commit 48619f2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

litellm/litellm_core_utils/litellm_logging.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,16 +996,23 @@ def post_call(
996996
self.model_call_details["additional_args"] = additional_args
997997
self.model_call_details["log_event_type"] = "post_api_call"
998998

999+
if self.litellm_request_debug:
1000+
attr = "warning"
1001+
else:
1002+
attr = "debug"
1003+
9991004
if json_logs:
1000-
verbose_logger.debug(
1005+
callattr = getattr(verbose_logger, attr)
1006+
callattr(
10011007
"RAW RESPONSE:\n{}\n\n".format(
10021008
self.model_call_details.get(
10031009
"original_response", self.model_call_details
10041010
)
10051011
),
10061012
)
10071013
else:
1008-
print_verbose(
1014+
callattr = getattr(verbose_logger, attr)
1015+
callattr(
10091016
"RAW RESPONSE:\n{}\n\n".format(
10101017
self.model_call_details.get(
10111018
"original_response", self.model_call_details

0 commit comments

Comments
 (0)