mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
Turn on message logging via request header
This commit is contained in:
parent
9931a0d082
commit
b564656651
1 changed files with 4 additions and 0 deletions
|
@ -32,6 +32,10 @@ def redact_message_input_output_from_logging(
|
|||
if litellm.turn_off_message_logging is not True:
|
||||
return result
|
||||
|
||||
request_headers = litellm_logging_obj.model_call_details['litellm_params']['metadata']['headers']
|
||||
if request_headers and request_headers.get('litellm-turn-on-message-logging', False):
|
||||
return result
|
||||
|
||||
# remove messages, prompts, input, response from logging
|
||||
litellm_logging_obj.model_call_details["messages"] = [
|
||||
{"role": "user", "content": "redacted-by-litellm"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue