Ë
    µŒjE$  ã                   ó¼   — d Z ddlmZ ddlmZmZmZmZmZm	Z	 ddl
Z
ddlZddlmZmZ ddlmZ  G d„ de«      Z G d	„ d
e«      Z G d„ de«      Z G d„ de«      ZeZy)z@Lightweight wrapper around requests library, with async support.é    )Úasynccontextmanager)ÚAnyÚAsyncGeneratorÚDictÚLiteralÚOptionalÚUnionN)Ú	BaseModelÚ
ConfigDict)ÚResponsec                   ó  — e Zd ZU dZdZeeeef      ed<   dZ	ee
j                     ed<   dZee   ed<   dZee   ed<    edd¬	«      Zd
ededej&                  fd„Zd
edeeef   dedej&                  fd„Zd
edeeef   dedej&                  fd„Zd
edeeef   dedej&                  fd„Zd
ededej&                  fd„Zeded
ededee
j6                  df   fd„«       Zed
ededee
j6                  df   fd„«       Zed
edeeef   dedee
j6                  df   fd„«       Zed
edeeef   dedee
j6                  df   fd„«       Zed
edeeef   dedee
j6                  df   fd„«       Z ed
ededee
j6                  df   fd„«       Z!y)ÚRequestszÇWrapper around requests to handle auth and async.

    The main purpose of this wrapper is to handle authentication (by saving
    headers) and enable easy async methods on the same base object.
    NÚheadersÚ
aiosessionÚauthTÚverifyÚforbid©Úarbitrary_types_allowedÚextraÚurlÚkwargsÚreturnc                 ór   — t        j                  |f| j                  | j                  | j                  dœ|¤ŽS )ú GET the URL and return the text.©r   r   r   )ÚrequestsÚgetr   r   r   ©Úselfr   r   s      úp/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/langchain_community/utilities/requests.pyr   zRequests.get   s6   € ä�|‰|Øð
ØŸ™¨D¯I©I¸d¿k¹kñ
ØMSñ
ð 	
ó    Údatac                 ót   — t        j                  |f|| j                  | j                  | j                  dœ|¤ŽS )ú$POST to the URL and return the text.©Újsonr   r   r   )r   Úpostr   r   r   ©r    r   r#   r   s       r!   r(   zRequests.post#   s=   € ä�}‰}Øð
àØ—L‘LØ—‘Ø—;‘;ñ
ð ñ
ð 	
r"   c                 ót   — t        j                  |f|| j                  | j                  | j                  dœ|¤ŽS )ú"PATCH the URL and return the text.r&   )r   Úpatchr   r   r   r)   s       r!   r,   zRequests.patch.   s=   € ä�~‰~Øð
àØ—L‘LØ—‘Ø—;‘;ñ
ð ñ
ð 	
r"   c                 ót   — t        j                  |f|| j                  | j                  | j                  dœ|¤ŽS )ú PUT the URL and return the text.r&   )r   Úputr   r   r   r)   s       r!   r/   zRequests.put9   s=   € ä�|‰|Øð
àØ—L‘LØ—‘Ø—;‘;ñ
ð ñ
ð 	
r"   c                 ór   — t        j                  |f| j                  | j                  | j                  dœ|¤ŽS )ú#DELETE the URL and return the text.r   )r   Údeleter   r   r   r   s      r!   r2   zRequests.deleteD   s6   € ä�‰Øð
ØŸ™¨D¯I©I¸d¿k¹kñ
ØMSñ
ð 	
r"   Úmethodc                óN  K  — | j                   swt        j                  «       4 ƒd{  –—† } |j                  ||f| j                  | j
                  dœ|¤Ž4 ƒd{  –—† }|­–— ddd«      ƒd{  –—†  ddd«      ƒd{  –—†  y | j                   j                  ||f| j                  | j
                  dœ|¤Ž4 ƒd{  –—† }|­–— ddd«      ƒd{  –—†  y7 Œ²7 Œ€7 Œm# 1 ƒd{  –—†7  sw Y   Œ}xY w7 Œt# 1 ƒd{  –—†7  sw Y   yxY w7 ŒL7 Œ9# 1 ƒd{  –—†7  sw Y   yxY w­w)zMake an async request.N)r   r   )r   ÚaiohttpÚClientSessionÚrequestr   r   )r    r3   r   r   ÚsessionÚresponses         r!   Ú	_arequestzRequests._arequestJ   s  è ø€ ð
 �ŠÜ×,Ñ,×.Ô.°'Ø*˜7Ÿ?™?ØØðð !ŸL™LØŸ™ñ	ð
 ÷ò ð Ø"“N÷÷ ÷ /×.Ð.ð /�t—‘×.Ñ.ØØðð Ÿ™Ø—Y‘Yñ	ð
 ÷ò ð Ø“÷÷ ð ð /øðøð ø÷ ÷ ñ úð /ø×.×.Ñ.úðøð ø÷ ÷ ñ üsÎ   ‚%D%§C¨D%«0C7ÁCÁC7ÁC Á%C7Á0CÁ1C7Á5D%Â C5Â>D%Â?DÃ D%ÃDÃ	D%ÃDÃD%ÃC7ÃC7Ã C2	Ã&C)Ã'C2	Ã.C7Ã5D%Ã7D	Ã=D Ã>D	ÄD%ÄD%ÄD"ÄDÄD"ÄD%c                ó¢   K  —  | j                   d|fi |¤Ž4 ƒd{  –—† }|­–— ddd«      ƒd{  –—†  y7 Œ7 Œ# 1 ƒd{  –—†7  sw Y   yxY w­w)ú/GET the URL and return the text asynchronously.ÚGETN©r:   ©r    r   r   r9   s       r!   ÚagetzRequests.agetc   s@   è ø€ ð
 "�4—>‘> %¨Ñ7°×7Ò7¸8Ø‹N÷ 8×7Ñ7øÐ7ø×7×7Ñ7üó<   ‚A›6œAŸ:¥A°8±A¸AºAÁ AÁAÁAc                ó¦   K  —  | j                   d|fd|i|¤Ž4 ƒd{  –—† }|­–— ddd«      ƒd{  –—†  y7 Œ7 Œ# 1 ƒd{  –—†7  sw Y   yxY w­w)ú3POST to the URL and return the text asynchronously.ÚPOSTr'   Nr>   ©r    r   r#   r   r9   s        r!   ÚapostzRequests.apostk   sF   è ø€ ð
 "�4—>‘> &¨#ÑC°DÐC¸F×CÒCÀxØ‹N÷ D×CÑCøÐCø×C×CÑCüó<   ‚A�8žA¡<§A²:³AºA¼AÁAÁAÁ
Ac                ó¦   K  —  | j                   d|fd|i|¤Ž4 ƒd{  –—† }|­–— ddd«      ƒd{  –—†  y7 Œ7 Œ# 1 ƒd{  –—†7  sw Y   yxY w­w)ú1PATCH the URL and return the text asynchronously.ÚPATCHr'   Nr>   rE   s        r!   ÚapatchzRequests.apatchs   sF   è ø€ ð
 "�4—>‘> '¨3ÑD°TÐD¸V×DÒDÈØ‹N÷ E×DÑDøÐDø×D×DÑDürG   c                ó¦   K  —  | j                   d|fd|i|¤Ž4 ƒd{  –—† }|­–— ddd«      ƒd{  –—†  y7 Œ7 Œ# 1 ƒd{  –—†7  sw Y   yxY w­w)ú/PUT the URL and return the text asynchronously.ÚPUTr'   Nr>   rE   s        r!   ÚaputzRequests.aput{   sF   è ø€ ð
 "�4—>‘> %¨ÑB°4ÐB¸6×BÒBÀhØ‹N÷ C×BÑBøÐBø×B×BÑBürG   c                ó¢   K  —  | j                   d|fi |¤Ž4 ƒd{  –—† }|­–— ddd«      ƒd{  –—†  y7 Œ7 Œ# 1 ƒd{  –—†7  sw Y   yxY w­w)ú2DELETE the URL and return the text asynchronously.ÚDELETENr>   r?   s       r!   ÚadeletezRequests.adeleteƒ   s@   è ø€ ð
 "�4—>‘> (¨CÑ:°6×:Ò:¸hØ‹N÷ ;×:Ñ:øÐ:ø×:×:Ñ:ürA   )"Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   ÚstrÚ__annotations__r   r5   r6   r   r   r   Úboolr   Úmodel_configr   r   r   r(   r,   r/   r2   r   r   ÚClientResponser:   r@   rF   rK   rO   rS   © r"   r!   r   r      sÎ  … ñð )-€GˆX�d˜3 ˜8‘nÑ%Ó,Ø26€J�˜×.Ñ.Ñ/Ó6Ø€Dˆ(�3‰-ÓØ!€FˆH�T‰NÓ!áØ $Øô€Lð

�sð 
 cð 
¨h×.?Ñ.?ó 
ð	
˜ð 	
 4¨¨S¨¡>ð 	
¸Sð 	
ÀX×EVÑEVó 	
ð	
˜ð 	
 D¨¨c¨¡Nð 	
¸cð 	
Àh×FWÑFWó 	
ð	
�sð 	
 $ s¨C x¡.ð 	
¸Cð 	
ÀH×DUÑDUó 	
ð
˜#ð 
¨ð 
°×1BÑ1Bó 
ð ðØðØ #ðØ/2ðà	˜×.Ñ.°Ð4Ñ	5òó ðð0 ðØðØ"%ðà	˜×.Ñ.°Ð4Ñ	5òó ðð ðØðØ" 3¨ 8™nðØ8;ðà	˜×.Ñ.°Ð4Ñ	5òó ðð ðØðØ" 3¨ 8™nðØ8;ðà	˜×.Ñ.°Ð4Ñ	5òó ðð ðØðØ" 3¨ 8™nðØ8;ðà	˜×.Ñ.°Ð4Ñ	5òó ðð ðØðØ"%ðà	˜×.Ñ.°Ð4Ñ	5òó ñr"   r   c                   óø  — e Zd ZU dZdZeeeef      ed<   dZ	ee
j                     ed<   dZee   ed<   dZed   ed<   d	Zeed
<    ed	d¬«      Zedefd„«       Zdedeeeeef   f   fd„Zde
j4                  deeeeef   f   fd„Zdededeeeeef   f   fd„Zdedeeef   dedeeeeef   f   fd„Zdedeeef   dedeeeeef   f   fd„Zdedeeef   dedeeeeef   f   fd„Zdededeeeeef   f   fd„Z dededeeeeef   f   fd„Z!dedeeef   dedeeeeef   f   fd„Z"dedeeef   dedeeeeef   f   fd„Z#dedeeef   dedeeeeef   f   fd„Z$dededeeeeef   f   fd„Z%y)ÚGenericRequestsWrapperz,Lightweight wrapper around requests library.Nr   r   r   Útext©r`   r'   Úresponse_content_typeTr   r   r   r   c                 óp   — t        | j                  | j                  | j                  | j                  ¬«      S )N)r   r   r   r   )r   r   r   r   r   )r    s    r!   r   zGenericRequestsWrapper.requestsš   s+   € äØ—L‘LØ—‘Ø—‘Ø—;‘;ô	
ð 	
r"   r9   c                 ó¦   — | j                   dk(  r|j                  S | j                   dk(  r|j                  «       S t        d| j                   › �«      ‚©Nr`   r'   zInvalid return type: ©rb   r`   r'   Ú
ValueError©r    r9   s     r!   Ú_get_resp_contentz(GenericRequestsWrapper._get_resp_content£   sN   € Ø×%Ñ%¨Ò/Ø—=‘=Ð Ø×'Ñ'¨6Ò1Ø—=‘=“?Ð"äÐ4°T×5OÑ5OÐ4PÐQÓRÐRr"   c              ƒ   óÞ   K  — | j                   dk(  r|j                  «       ƒ d {  –—† S | j                   dk(  r|j                  «       ƒ d {  –—† S t        d| j                   › �«      ‚7 ŒC7 Œ­wre   rf   rh   s     r!   Ú_aget_resp_contentz)GenericRequestsWrapper._aget_resp_content«   se   è ø€ ð ×%Ñ%¨Ò/Ø!Ÿ™›×(Ð(Ø×'Ñ'¨6Ò1Ø!Ÿ™›×(Ð(äÐ4°T×5OÑ5OÐ4PÐQÓRÐRð	 )øà(ús!   ‚#A-¥A)¦&A-ÁA+ÁA-Á+A-r   r   c                 óZ   — | j                   | j                  j                  |fi |¤Ž«      S )r   )ri   r   r   r   s      r!   r   zGenericRequestsWrapper.getµ   s*   € à×%Ñ%Ð&7 d§m¡m×&7Ñ&7¸Ñ&F¸vÑ&FÓGÐGr"   r#   c                 ó\   — | j                   | j                  j                  ||fi |¤Ž«      S )r%   )ri   r   r(   r)   s       r!   r(   zGenericRequestsWrapper.post¹   s.   € ð ×%Ñ%Ð&8 d§m¡m×&8Ñ&8¸¸dÑ&MÀfÑ&MÓNÐNr"   c                 ó\   — | j                   | j                  j                  ||fi |¤Ž«      S )r+   )ri   r   r,   r)   s       r!   r,   zGenericRequestsWrapper.patch¿   s.   € ð ×%Ñ%Ð&9 d§m¡m×&9Ñ&9¸#¸tÑ&NÀvÑ&NÓOÐOr"   c                 ó\   — | j                   | j                  j                  ||fi |¤Ž«      S )r.   )ri   r   r/   r)   s       r!   r/   zGenericRequestsWrapper.putÅ   s.   € ð ×%Ñ%Ð&7 d§m¡m×&7Ñ&7¸¸TÑ&LÀVÑ&LÓMÐMr"   c                 óZ   — | j                   | j                  j                  |fi |¤Ž«      S )r1   )ri   r   r2   r   s      r!   r2   zGenericRequestsWrapper.deleteË   s*   € à×%Ñ%Ð&: d§m¡m×&:Ñ&:¸3Ñ&IÀ&Ñ&IÓJÐJr"   c              ‹   óà   K  —  | j                   j                  |fi |¤Ž4 ƒd{  –—† }| j                  |«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ.7 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)r<   N)r   r@   rk   r?   s       r!   r@   zGenericRequestsWrapper.agetÏ   sT   è ø€ à%�4—=‘=×%Ñ% cÑ4¨V×4Ò4¸Ø×0Ñ0°Ó:×:÷ 5×4Ò4øØ:øð 5ø×4×4Ñ4üóT   ‚"A.¤A¥A.¨A½A¾AÁA.ÁAÁA.ÁAÁA.ÁA+ÁA"Á A+Á'A.c              ‹   óâ   K  —  | j                   j                  ||fi |¤Ž4 ƒd{  –—† }| j                  |«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ.7 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)rC   N)r   rF   rk   rE   s        r!   rF   zGenericRequestsWrapper.apostÔ   sX   è ø€ ð '�4—=‘=×&Ñ& s¨DÑ;°F×;Ò;¸xØ×0Ñ0°Ó:×:÷ <×;Ò;øØ:øð <ø×;×;Ñ;üóT   ‚#A/¥A¦A/©A¾A¿AÁA/ÁAÁA/ÁAÁA/ÁA,Á A#Á!A,Á(A/c              ‹   óâ   K  —  | j                   j                  ||fi |¤Ž4 ƒd{  –—† }| j                  |«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ.7 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)rI   N)r   rK   rk   rE   s        r!   rK   zGenericRequestsWrapper.apatchÛ   sX   è ø€ ð (�4—=‘=×'Ñ'¨¨TÑ<°V×<Ò<ÀØ×0Ñ0°Ó:×:÷ =×<Ò<øØ:øð =ø×<×<Ñ<ürt   c              ‹   óâ   K  —  | j                   j                  ||fi |¤Ž4 ƒd{  –—† }| j                  |«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ.7 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)rM   N)r   rO   rk   rE   s        r!   rO   zGenericRequestsWrapper.aputâ   sX   è ø€ ð &�4—=‘=×%Ñ% c¨4Ñ:°6×:Ò:¸hØ×0Ñ0°Ó:×:÷ ;×:Ò:øØ:øð ;ø×:×:Ñ:ürt   c              ‹   óà   K  —  | j                   j                  |fi |¤Ž4 ƒd{  –—† }| j                  |«      ƒ d{  –—† cddd«      ƒd{  –—†  S 7 Œ.7 Œ7 Œ	# 1 ƒd{  –—†7  sw Y   yxY w­w)rQ   N)r   rS   rk   r?   s       r!   rS   zGenericRequestsWrapper.adeleteé   sT   è ø€ à(�4—=‘=×(Ñ(¨Ñ7°×7Ò7¸8Ø×0Ñ0°Ó:×:÷ 8×7Ò7øØ:øð 8ø×7×7Ñ7ürr   )&rT   rU   rV   rW   r   r   r   rX   rY   r   r5   r6   r   r   rb   r   r   rZ   r   r[   Úpropertyr   r   r   r	   ri   r\   rk   r   r(   r,   r/   r2   r@   rF   rK   rO   rS   r]   r"   r!   r_   r_   Œ   s  … Ù6à(,€GˆX�d˜3 ˜8‘nÑ%Ó,Ø26€J�˜×.Ñ.Ñ/Ó6Ø€Dˆ(�3‰-ÓØ5;Ð˜7 >Ñ2Ó;Ø€FˆDÓáØ $Øô€Lð
 ð
˜(ò 
ó ð
ðS¨(ð S°u¸SÀ$ÀsÈCÀxÁ.Ð=PÑ7Qó SðSØ×.Ñ.ðSà	ˆs�D˜˜c˜‘NÐ"Ñ	#óSðH�sð H cð H¨e°C¸¸cÀ3¸h¹Ð4GÑ.Hó HðOØðOØ" 3¨ 8™nðOØ8;ðOà	ˆs�D˜˜c˜‘NÐ"Ñ	#óOðPØðPØ" 3¨ 8™nðPØ8;ðPà	ˆs�D˜˜c˜‘NÐ"Ñ	#óPðNØðNØ" 3¨ 8™nðNØ8;ðNà	ˆs�D˜˜c˜‘NÐ"Ñ	#óNðK˜#ð K¨ð K°°s¸DÀÀcÀ¹NÐ7JÑ1Kó Kð;˜cð ;¨Sð ;°U¸3ÀÀSÈ#ÀXÁÐ;NÑ5Oó ;ð
;Øð;Ø" 3¨ 8™nð;Ø8;ð;à	ˆs�D˜˜c˜‘NÐ"Ñ	#ó;ð;Øð;Ø" 3¨ 8™nð;Ø8;ð;à	ˆs�D˜˜c˜‘NÐ"Ñ	#ó;ð;Øð;Ø" 3¨ 8™nð;Ø8;ð;à	ˆs�D˜˜c˜‘NÐ"Ñ	#ó;ð; ð ;°ð ;¸¸cÀ4ÈÈSÈÁ>Ð>QÑ8Rô ;r"   r_   c                   ó&   — e Zd ZU dZdZed   ed<   y)ÚJsonRequestsWrapperz‰Lightweight wrapper around requests library, with async support.

    The main purpose of this wrapper is to always return a json output.r'   ra   rb   N©rT   rU   rV   rW   rb   r   rY   r]   r"   r!   rz   rz   ï   ó   … ñKð 6<Ð˜7 >Ñ2Ô;r"   rz   c                   ó&   — e Zd ZU dZdZed   ed<   y)ÚTextRequestsWrapperz‰Lightweight wrapper around requests library, with async support.

    The main purpose of this wrapper is to always return a text output.r`   ra   rb   Nr{   r]   r"   r!   r~   r~   ÷   r|   r"   r~   )rW   Ú
contextlibr   Útypingr   r   r   r   r   r	   r5   r   Úpydanticr
   r   r   r   r_   rz   r~   ÚRequestsWrapperr]   r"   r!   Ú<module>rƒ      s\   ðÙ Få *ß F× Fã Û ß *Ý ô}ˆyô }ô@`;˜Yô `;ôF<Ð0ô <ô<Ð0ô <ð &�r"   