fix guardrail linting change

This commit is contained in:
Ishaan Jaff 2024-09-16 20:12:54 -07:00
parent 7e9dbcd1a3
commit 1e59395280

View file

@ -17,11 +17,6 @@ class CustomGuardrail(CustomLogger):
self.event_hook: Optional[GuardrailEventHooks] = event_hook
super().__init__(**kwargs)
# older v1 implementation - not used, just kept for backward compatibility
self.moderation_check: Literal["pre_call", "in_parallel"] = kwargs.get(
"moderation_check", "pre_call"
)
def should_run_guardrail(self, data, event_type: GuardrailEventHooks) -> bool:
metadata = data.get("metadata") or {}
requested_guardrails = metadata.get("guardrails") or []