Ë
    µŒj×  ã            
       ój   — d dl mZmZ deeeeef   f   deeeeeeef   f   f   fd„Zdededefd„Zy)	é    )ÚDictÚUnionÚinputÚreturnc                 óè  — 	 ddl }t        | t        «      r.|j	                  | g«      }|j
                  d   |j                  dœS t        | t        «      rqt        «       }| D ]  }|j                  | |   «       Œ |j	                  |«      }|j
                  }d}t        «       }| D ]  }||   ||<   |dz  }Œ ||j                  dœS t        dt        | «      › �«      ‚# t        $ r t        d«      ‚w xY w)aû  
    Sanitize input string or dict of strings by replacing sensitive data with
    placeholders.

    It returns the sanitized input string or dict of strings and the secure
    context as a dict following the format:
    {
        "sanitized_input": <sanitized input string or dict of strings>,
        "secure_context": <secure context>
    }

    The secure context is a bytes object that is needed to de-sanitize the response
    from the LLM.

    Args:
        input: Input string or dict of strings.

    Returns:
        Sanitized input string or dict of strings and the secure context
        as a dict following the format:
        {
            "sanitized_input": <sanitized input string or dict of strings>,
            "secure_context": <secure context>
        }

        The `secure_context` needs to be passed to the `desanitize` function.

    Raises:
        ValueError: If the input is not a string or dict of strings.
        ImportError: If the `opaqueprompts` Python package is not installed.
    r   NúhCould not import the `opaqueprompts` Python package, please install it with `pip install opaqueprompts`.)Úsanitized_inputÚsecure_contexté   zUnexpected input type )ÚopaquepromptsÚImportErrorÚ
isinstanceÚstrÚsanitizeÚsanitized_textsr
   ÚdictÚlistÚappendÚ
ValueErrorÚtype)	r   ÚopÚsanitize_responseÚvaluesÚkeyÚsanitize_values_responseÚsanitized_input_valuesÚidxr	   s	            úu/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/langchain_community/utilities/opaqueprompts.pyr   r      s  € ðD
Û"ô �%œÔà13·±¸e¸WÓ1EÐà0×@Ñ@ÀÑCØ/×>Ñ>ñ
ð 	
ô
 �%œÔä“ˆó ˆCØ�M‰M˜% ™*Õ%ð ð 9;¿¹ÀFÓ8KÐ ð ":×!IÑ!IÐØˆÜ›&ˆÛˆCØ#9¸#Ñ#>ˆO˜CÑ Ø�1‰H‰Cð ð
  /Ø6×EÑEñ
ð 	
ô
 Ð-¬d°5«k¨]Ð;Ó
<Ð<øôM ò 
ÜðBó
ð 	
ð
ús   ‚C ÃC1Úsanitized_textr
   c                 óx   — 	 ddl }|j                  | |«      }|j                  S # t        $ r t        d«      ‚w xY w)zî
    Restore the original sensitive data from the sanitized text.

    Args:
        sanitized_text: Sanitized text.
        secure_context: Secure context returned by the `sanitize` function.

    Returns:
        De-sanitized text.
    r   Nr   )r   r   Ú
desanitizeÚdesanitized_text)r   r
   r   Údesanitize_responses       r   r!   r!   Q   sR   € ð
Û"ð 24·±Ø˜ó2Ðð ×/Ñ/Ð/øô ò 
ÜðBó
ð 	
ð
ús   ‚$ ¤9N)Útypingr   r   r   r   Úbytesr!   © ó    r   Ú<module>r(      si   ðß ðJ=Ø��d˜3 ˜8‘nÐ$Ñ%ðJ=à	ˆ#ˆu�S˜$˜s C˜x™.Ð(Ñ)Ð
)Ñ*óJ=ðZ0˜sð 0°Eð 0¸cô 0r'   