Ë
    tPêjY
  ã                   óŽ   — U d Z ddlZddlmZmZmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ erddlmZ d	Zeed
<    G d„ de
«      Zy)u@   
Qostodian Nexus (by Qohash) â€” LiteLLM guardrail integration.
é    N)ÚTYPE_CHECKINGÚFinalÚLiteralÚOptional)Úlog_guardrail_information)ÚGenericGuardrailAPI©ÚQostodianNexusConfigModel)ÚGenericGuardrailAPIInputs)ÚLoggingÚqostodian_nexusÚGUARDRAIL_NAMEc                   óŠ   ‡ — e Zd Z	 ddedz  fˆ fd„Ze	 ddededed   de	d	   d
ef
ˆ fd„«       Z
ed
ee   dz  fd„«       Zˆ xZS )ÚQostodianNexusNÚapi_basec                 ó  •— |xs  t         j                  j                  dd«      }|j                  dt        «      |d<   g d¢}|j                  d«      xs g }||D �cg c]	  }||vsŒ|‘Œ c}z   |d<   t	        ‰| �  dd|i|¤Ž y c c}w )NÚQOSTODIAN_NEXUS_API_BASEzhttp://nexus:8800Úguardrail_name)z#x-qostodian-nexus-identifiers-tracez$x-qostodian-nexus-identifiers-sourcez'x-qostodian-nexus-identifiers-containerz&x-qostodian-nexus-identifiers-identityÚextra_headersr   © )ÚosÚenvironÚgetr   ÚsuperÚ__init__)Úselfr   ÚkwargsÚnexus_headersÚexistingÚhÚ	__class__s         €ú{/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.pyr   zQostodianNexus.__init__   s˜   ø€ ð
 Ò^œrŸz™zŸ~™~Ð.HÐJ]Ó^ˆà#)§:¡:Ð.>ÄÓ#OˆÐÑ ò 
ˆð !Ÿ*™* _Ó5Ò;¸ˆØ"/¸hÖ2a¸È!ÐS`ÒJ`²1Ò2aÑ"aˆˆÑä‰Ññ 	
Øð	
àó	
ùò 3bs   Á	BÁ'BÚinputsÚrequest_dataÚ
input_type)ÚrequestÚresponseÚlogging_objÚLiteLLMLoggingObjÚreturnc              ƒ   óF   •K  — t         ‰| �  ||||¬«      ƒ d{  –—† S 7 Œ­w)ak  
        Apply Qostodian Nexus to the given inputs.

        NOTE: This override is intentionally a pass-through. It must be present
        directly in this class's __dict__ so that LiteLLM's unified guardrail
        routing check (`"apply_guardrail" in type(callback).__dict__` in
        litellm/proxy/utils.py) routes calls correctly. Do not remove.
        )r#   r$   r%   r(   N)r   Úapply_guardrail)r   r#   r$   r%   r(   r!   s        €r"   r,   zQostodianNexus.apply_guardrail1   s6   øè ø€ ô  ‘WÑ,ØØ%Ø!Ø#ð	 -ó 
÷ 
ð 	
ð 
ús   ƒ!š›!c                 ó   — t         S )z?
        Returns the config model for Qostodian Nexus.
        r	   )Úclss    r"   Úget_config_modelzQostodianNexus.get_config_modelH   s
   € ô
 )Ð(ó    )N)Ú__name__Ú
__module__Ú__qualname__Ústrr   r   r   Údictr   r   r,   ÚclassmethodÚtyper
   r/   Ú__classcell__)r!   s   @r"   r   r      s”   ø„ ð  $ñ
à˜‘*õ
ð2 ð 6:ñ
à)ð
ð ð
ð Ð1Ñ2ð	
ð
 Ð1Ñ2ð
ð 
#ô
ó ð
ð, ð) Ð&?Ñ!@À4Ñ!Gò )ó ô)r0   r   )Ú__doc__r   Útypingr   r   r   r   Ú%litellm.integrations.custom_guardrailr   ÚTlitellm.proxy.guardrails.guardrail_hooks.generic_guardrail_api.generic_guardrail_apir   Ú5litellm.types.proxy.guardrails.guardrail_hooks.qohashr
   Úlitellm.types.utilsr   Ú*litellm.litellm_core_utils.litellm_loggingr   r)   r   Ú__annotations__r   r   r0   r"   ú<module>rA      sD   ðòó 
ß :Ó :å Kõõõ :áÝWà)€�Ó )ô6)Ð(õ 6)r0   