working lakera ai during call hook

This commit is contained in:
Ishaan Jaff 2024-08-20 14:39:04 -07:00
parent 1a142053e5
commit 1fdebfb0b7
5 changed files with 28 additions and 22 deletions

View file

@ -301,8 +301,9 @@ class lakeraAI_Moderation(CustomGuardrail):
user_api_key_dict: UserAPIKeyAuth,
call_type: Literal["completion", "embeddings", "image_generation"],
):
if self.moderation_check == "pre_call":
return
if self.event_hook is None:
if self.moderation_check == "pre_call":
return
from litellm.types.guardrails import GuardrailEventHooks