mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
feat(lakera_ai.py): control running prompt injection between pre-call and in_parallel
This commit is contained in:
parent
a32a7af215
commit
99a5436ed5
6 changed files with 211 additions and 37 deletions
|
@ -38,6 +38,8 @@ def initialize_guardrails(
|
|||
verbose_proxy_logger.debug(guardrail.guardrail_name)
|
||||
verbose_proxy_logger.debug(guardrail.default_on)
|
||||
|
||||
callback_specific_params.update(guardrail.callback_args)
|
||||
|
||||
if guardrail.default_on is True:
|
||||
# add these to litellm callbacks if they don't exist
|
||||
for callback in guardrail.callbacks:
|
||||
|
@ -46,7 +48,7 @@ def initialize_guardrails(
|
|||
|
||||
if guardrail.logging_only is True:
|
||||
if callback == "presidio":
|
||||
callback_specific_params["logging_only"] = True
|
||||
callback_specific_params["logging_only"] = True # type: ignore
|
||||
|
||||
default_on_callbacks_list = list(default_on_callbacks)
|
||||
if len(default_on_callbacks_list) > 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue