Ë
    µŒjE  ã                   óR   — d Z ddlmZmZmZ ddlmZ ddlmZm	Z	m
Z
  G d„ de«      Zy)zUtil that calls Twilio.é    )ÚAnyÚDictÚOptional)Úget_from_dict_or_env)Ú	BaseModelÚ
ConfigDictÚmodel_validatorc                   ó¼   — e Zd ZU dZdZeed<   dZee	   ed<   	 dZ
ee	   ed<   	 dZee	   ed<   	  edd¬	«      Z ed
¬«      ededefd„«       «       Zde	de	de	fd„Zy)ÚTwilioAPIWrappera�  Messaging Client using Twilio.

    To use, you should have the ``twilio`` python package installed,
    and the environment variables ``TWILIO_ACCOUNT_SID``, ``TWILIO_AUTH_TOKEN``, and
    ``TWILIO_FROM_NUMBER``, or pass `account_sid`, `auth_token`, and `from_number` as
    named parameters to the constructor.

    Example:
        .. code-block:: python

            from langchain_community.utilities.twilio import TwilioAPIWrapper
            twilio = TwilioAPIWrapper(
                account_sid="ACxxx",
                auth_token="xxx",
                from_number="+10123456789"
            )
            twilio.run('test', '+12484345508')
    NÚclientÚaccount_sidÚ
auth_tokenÚfrom_numberFÚforbid)Úarbitrary_types_allowedÚextraÚbefore)ÚmodeÚvaluesÚreturnc                 ó°   — 	 ddl m} t        |dd«      }t        |dd«      }t        |dd	«      |d<    |||«      |d
<   |S # t        $ r t        d«      ‚w xY w)z?Validate that api key and python package exists in environment.r   )ÚClientzTCould not import twilio python package. Please install it with `pip install twilio`.r   ÚTWILIO_ACCOUNT_SIDr   ÚTWILIO_AUTH_TOKENr   ÚTWILIO_FROM_NUMBERr   )Útwilio.restr   ÚImportErrorr   )Úclsr   r   r   r   s        ún/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/langchain_community/utilities/twilio.pyÚvalidate_environmentz%TwilioAPIWrapper.validate_environment3   s|   € ð	Ý*ô +¨6°=ÐBVÓWˆÜ)¨&°,Ð@SÓTˆ
Ü 4Ø�MÐ#7ó!
ˆˆ}Ññ " +¨zÓ:ˆˆxÑØˆøô ò 	Üð?óð ð	ús   ‚A  Á AÚbodyÚtoc                 ó~   — | j                   j                  j                  || j                  |¬«      }|j                  S )añ  Run body through Twilio and respond with message sid.

        Args:
            body: The text of the message you want to send. Can be up to 1,600
                characters in length.
            to: The destination phone number in
                [E.164](https://www.twilio.com/docs/glossary/what-e164) format for
                SMS/MMS or
                [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses)
                for other 3rd-party channels.
        )Úfrom_r!   )r   ÚmessagesÚcreater   Úsid)Úselfr!   r"   Úmessages       r   ÚrunzTwilioAPIWrapper.runF   s5   € ð —+‘+×&Ñ&×-Ñ-¨b¸×8HÑ8HÈtÐ-ÓTˆØ�{‰{Ðó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__annotations__r   r   Ústrr   r   r   Úmodel_configr	   Úclassmethodr   r    r*   © r+   r   r   r   	   s£   … ñð& €FˆCÓØ!%€K�˜#‘Ó%Ø+Ø $€J�˜‘Ó$ØØ!%€K�˜#‘Ó%ð	ñ Ø %Øô€Lñ
 ˜(Ô#Øð¨$ð °3ò ó ó $ðð"˜ð  ð ¨ô r+   r   N)r/   Útypingr   r   r   Úlangchain_core.utilsr   Úpydanticr   r   r	   r   r4   r+   r   Ú<module>r8      s%   ðÙ ç &Ñ &å 5ß ;Ñ ;ôJ�yõ Jr+   