
    ^h                     N    S SK JrJr  S SKJr  S SKJr  S SKJr   " S S\5      r	g)    )ListOptional)verbose_logger)CustomLogger)GuardrailEventHooksc                   l   ^  \ rS rSr   S
S\\   S\\\      S\\   4U 4S jjjrS\S\	4S jr
S	rU =r$ )CustomGuardrail   guardrail_namesupported_event_hooks
event_hookc                    > Xl         X l        X0l        U(       a  U(       a  X2;  a  [        SU SU 35      e[        TU ]  " S0 UD6  g )NzEvent hook z% is not in the supported event hooks  )r   r   r   
ValueErrorsuper__init__)selfr   r   r   kwargs	__class__s        _/home/james-whalen/.local/lib/python3.13/site-packages/litellm/integrations/custom_guardrail.pyr   CustomGuardrail.__init__
   sS     -%:"9C jE !*-RShRij  	"6"    
event_typereturnc                    UR                  S5      =(       d    0 nUR                  S5      =(       d    / n[        R                  " SU R                  UU R                  U5        U R                  (       a!  U R                  U;  a  UR
                  S:w  a  gU R                  (       a  U R                  UR
                  :w  a  gg)Nmetadata
guardrailszxinside should_run_guardrail for guardrail=%s event_type= %s guardrail_supported_event_hooks= %s requested_guardrails= %slogging_onlyFT)getr   debugr   r   value)r   datar   r   requested_guardrailss        r   should_run_guardrail$CustomGuardrail.should_run_guardrail   s    88J'-2'||L9?R GOO 	
 OO##+??  N2??t*2B2BBr   )r   r   r   )NNN)__name__
__module____qualname____firstlineno__r   strr   r   r   boolr$   __static_attributes____classcell__)r   s   @r   r	   r	      sb     )-EI48	# #  (-@(AB# 01	# #&5H T  r   r	   N)
typingr   r   litellm._loggingr   "litellm.integrations.custom_loggerr   litellm.types.guardrailsr   r	   r   r   r   <module>r2      s    ! + ; 8+l +r   