From e1f8fb6c4687d3d264358465f9b8d8cd535f56c9 Mon Sep 17 00:00:00 2001 From: yucheng Date: Sat, 31 Oct 2026 01:10:32 -0700 Subject: [PATCH] fix(proxy): type the post-call gate input as a Mapping --- .../proxy/pass_through_endpoints/pass_through_endpoints.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py index 61651659556..70d677dfe4c 100644 --- a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py +++ b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py @@ -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) )