§
    æ˜ºhq  ã                   óZ   — d Z ddlmZmZmZ ddlmZmZmZ ddl	m
Z
  G d„ de¦  «        ZdS )zUtil that calls Twilio.é    )ÚAnyÚDictÚOptional)Ú	BaseModelÚExtraÚroot_validator)Úget_from_dict_or_envc                   óÐ   — e Zd ZU dZeed<   dZee         ed<   	 dZ	ee         ed<   	 dZ
ee         ed<   	  G d„ d¦  «        Z e¦   «         d	ed
efd„¦   «         Zdeded
efd„ZdS )Ú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')
    ÚclientNÚaccount_sidÚ
auth_tokenÚfrom_numberc                   ó$   — e Zd ZdZej        ZdZdS )úTwilioAPIWrapper.Configz'Configuration for this pydantic object.FN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚforbidÚextraÚarbitrary_types_allowed© ó    úl/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/langchain_community/utilities/twilio.pyÚConfigr   -   s#   € € € € € Ø5Ð5à”ˆØ"'ÐÐÐr   r   ÚvaluesÚreturnc                 óÚ   — 	 ddl m} n# t          $ r t          d¦  «        ‚w xY wt          |dd¦  «        }t          |dd¦  «        }t          |dd	¦  «        |d<    |||¦  «        |d
<   |S )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        r   Úvalidate_environmentz%TwilioAPIWrapper.validate_environment3   s­   € ð	Ø*Ð*Ð*Ð*Ð*Ð*Ð*øÝð 	ð 	ð 	Ýð?ñô ð ð	øøøõ
 +¨6°=ÐBVÑWÔWˆÝ)¨&°,Ð@SÑTÔTˆ
Ý 4Ø�MÐ#7ñ!
ô !
ˆˆ}Ñð "˜6 +¨zÑ:Ô:ˆˆxÑØˆs   ‚	 ‰#ÚbodyÚtoc                 ó^   — | 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.runE   s.   € ð ”+Ô&×-Ò-¨b¸Ô8HÈtÐ-ÑTÔTˆØŒ{Ðr   )r   r   r   r   r   Ú__annotations__r   r   Ústrr   r   r   r   r   r'   r1   r   r   r   r   r      sú   € € € € € € ðð ð& €K€K�KØ!%€K�˜#”Ð%Ð%Ñ%Ø+Ø $€J�˜”Ð$Ð$Ñ$ØØ!%€K�˜#”Ð%Ð%Ñ%ð	ð(ð (ð (ð (ð (ñ (ô (ð (ð €^ÑÔð¨$ð °4ð ð ð ñ Ôðð"˜ð  ð ¨ð ð ð ð ð ð r   r   N)r   Útypingr   r   r   Úlangchain_core.pydantic_v1r   r   r   Úlangchain_core.utilsr	   r   r   r   r   ú<module>r7      s—   ðØ Ð Ø &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &Ð &à GÐ GÐ GÐ GÐ GÐ GÐ GÐ GÐ GÐ GØ 5Ð 5Ð 5Ð 5Ð 5Ð 5ðJð Jð Jð Jð J�yñ Jô Jð Jð Jð Jr   