feat - redact messages from slack alerting

This commit is contained in:
Ishaan Jaff 2024-06-06 10:38:15 -07:00
parent 059c59f206
commit 1e8429bb20
3 changed files with 11 additions and 4 deletions

View file

@ -60,6 +60,7 @@ _async_failure_callback: List[Callable] = (
pre_call_rules: List[Callable] = [] pre_call_rules: List[Callable] = []
post_call_rules: List[Callable] = [] post_call_rules: List[Callable] = []
turn_off_message_logging: Optional[bool] = False turn_off_message_logging: Optional[bool] = False
redact_messages_in_exceptions: Optional[bool] = False
store_audit_logs = False # Enterprise feature, allow users to see audit logs store_audit_logs = False # Enterprise feature, allow users to see audit logs
## end of callbacks ############# ## end of callbacks #############

View file

@ -21,7 +21,9 @@ model_list:
general_settings: general_settings:
master_key: sk-1234 master_key: sk-1234
alerting: ["slack"]
litellm_settings: litellm_settings:
callbacks: ["otel"] callbacks: ["otel"]
store_audit_logs: true store_audit_logs: true
redact_messages_in_exceptions: True

View file

@ -8514,7 +8514,11 @@ def exception_type(
extra_information = f"\nModel: {model}" extra_information = f"\nModel: {model}"
if _api_base: if _api_base:
extra_information += f"\nAPI Base: `{_api_base}`" extra_information += f"\nAPI Base: `{_api_base}`"
if messages and len(messages) > 0: if (
messages
and len(messages) > 0
and litellm.redact_messages_in_exceptions is False
):
extra_information += f"\nMessages: `{messages}`" extra_information += f"\nMessages: `{messages}`"
if _model_group is not None: if _model_group is not None: