mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
fix(proxy): type the post-call gate input as a Mapping
This commit is contained in:
parent
205026dbe4
commit
e1f8fb6c46
1 changed files with 4 additions and 2 deletions
|
|
@ -885,10 +885,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