mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-11 08:38:24 +00:00
Merge branch 'litellm_lakera_v2_gemini_contents' into litellm_passthrough_applied_guardrails_header
This commit is contained in:
commit
75edf2c5a5
1 changed files with 4 additions and 2 deletions
|
|
@ -957,10 +957,12 @@ async def _inherit_auth_guardrails(
|
|||
return tuple(_GUARDRAIL_ENTRIES.validate_python(merged))
|
||||
|
||||
|
||||
def _named_guardrail_runs_post_call(data: dict[str, object]) -> bool:
|
||||
def _named_guardrail_runs_post_call(data: Mapping[str, object]) -> bool:
|
||||
return any(
|
||||
guardrail.default_on is not True
|
||||
and guardrail.should_run_guardrail(data=data, event_type=GuardrailEventHooks.post_call)
|
||||
and guardrail.should_run_guardrail( # pyright: ignore[reportUnknownMemberType] # takes the untyped request dict
|
||||
data=data, event_type=GuardrailEventHooks.post_call
|
||||
)
|
||||
for guardrail in litellm.logging_callback_manager.get_custom_loggers_for_type(callback_type=CustomGuardrail)
|
||||
if isinstance(guardrail, CustomGuardrail)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue