Ë
    tPêjb  ã                   ó¸   — U d Z ddlmZ ddlmZ ddlmZ ddlmZ  e«       Z	ee
d<   	 dded	ee   dz  d
efd„Zded
edz  fd„Zded
edz  fd„Zded
edz  fd„Zy)z4
Contains utils used by OpenAI compatible endpoints
é    )ÚFinal)ÚRequest)ÚSensitiveDataMasker©Ú_read_request_bodyÚSENSITIVE_DATA_MASKERNÚdeployment_dictÚexcluded_keysÚreturnc                 óf  — | d   j                  dd«       | d   j                  dd«       | d   j                  dd«       | d   j                  dd«       | d   j                  dd«       | d   j                  dd«       d	d
h}|xs
 t        «       |z  }t        j                  | d   |¬«      | d<   | S )at  
    Removes sensitive information from a deployment dictionary.

    Args:
        deployment_dict (dict): The deployment dictionary to remove sensitive information from.
        excluded_keys (Optional[Set[str]]): Set of keys that should not be masked (exact match).

    Returns:
        dict: The modified deployment dictionary with sensitive information removed.
    Úlitellm_paramsÚapi_keyNÚclient_secretÚvertex_credentialsÚvertex_ai_credentialsÚaws_access_key_idÚaws_secret_access_keyÚdefault_api_key_tpm_limitÚdefault_api_key_rpm_limit)r
   )ÚpopÚsetr   Ú	mask_dict)r	   r
   Ú_rate_limit_config_keysÚ	_excludeds       úu/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/proxy/common_utils/openai_endpoint_utils.pyÚ%remove_sensitive_info_from_deploymentr      sß   € ð Ð$Ñ%×)Ñ)¨)°TÔ:ØÐ$Ñ%×)Ñ)¨/¸4Ô@ØÐ$Ñ%×)Ñ)Ð*>ÀÔEØÐ$Ñ%×)Ñ)Ð*AÀ4ÔHØÐ$Ñ%×)Ñ)Ð*=¸tÔDØÐ$Ñ%×)Ñ)Ð*AÀ4ÔHð 	$Ø#ð&Ðð &Ò.¬«Ð2IÑI€Iä(=×(GÑ(GØÐ(Ñ)¸ð )Hó )€OÐ$Ñ%ð Ðó    Úrequestc              ƒ   óR   K  — t        | ¬«      ƒ d{  –—† xs i }d|v r|d   S y7 Œ­w)z`
    Get the `custom_llm_provider` from the request body

    Safely reads the request body
    ©r   NÚcustom_llm_providerr   )r   Úrequest_bodys     r   Ú)get_custom_llm_provider_from_request_bodyr#   4   s7   è ø€ ô '9ÀÔ&I× IÒ OÈR€LØ Ñ,ØÐ1Ñ2Ð2Øð !Jús   ‚'’%“'c                 ó>   — d| j                   v r| j                   d   S y)zx
    Get the `custom_llm_provider` from the request query parameters

    Safely reads the request query parameters
    r!   N)Úquery_paramsr    s    r   Ú*get_custom_llm_provider_from_request_queryr&   @   s'   € ð  × 4Ñ 4Ñ4Ø×#Ñ#Ð$9Ñ:Ð:Ør   c                 ó>   — d| j                   v r| j                   d   S y)zU
    Get the `custom_llm_provider` from the request header `custom-llm-provider`
    zcustom-llm-providerN)Úheadersr    s    r   Ú,get_custom_llm_provider_from_request_headersr)   K   s#   € ð  §¡Ñ/Ø�‰Ð4Ñ5Ð5Ør   )N)Ú__doc__Útypingr   Úfastapir   Ú0litellm.litellm_core_utils.sensitive_data_maskerr   Ú-litellm.proxy.common_utils.http_parsing_utilsr   r   Ú__annotations__Údictr   Ústrr   r#   r&   r)   © r   r   ú<module>r3      s˜   ðòõ å å PÝ Lá2Ó4Ð �uÓ 4ð
 &*ñ"Øð"à�s‘8˜d‘?ð"ð 
ó"ðJ	¸Wð 	ÈÈtÉó 	ð¸ð ÀCÈ$ÁJó ð¸'ð ÀcÈDÁjô r   