test(guardrails): type the native lifecycle logging_only test double
Some checks failed
ai-gateway image / ai-gateway release image (push) Waiting to run
LiteLLM Rust / rust-lint (push) Waiting to run
LiteLLM Rust / rust-test (push) Waiting to run
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
joshua-berri 2026-09-13 08:47:47 +00:00 committed by yucheng
parent c1d0d29d01
commit 49b2d71057

View file

@ -2902,9 +2902,15 @@ class _NativeLifecycleLoggingGuardrail(CustomGuardrail):
guardrail_name="native-logging-guardrail",
event_hook=GuardrailEventHooks.logging_only,
)
self.calls: list = []
self.calls: list[tuple[Literal["request", "response"], list[str]]] = []
async def apply_guardrail(self, inputs, request_data, input_type, logging_obj=None):
async def apply_guardrail(
self,
inputs: GenericGuardrailAPIInputs,
request_data: dict[str, object],
input_type: Literal["request", "response"],
logging_obj: "LiteLLMLoggingObj | None" = None,
) -> GenericGuardrailAPIInputs:
self.calls.append((input_type, list(inputs.get("texts") or [])))
return inputs