Ë
    µŒjâ	  ã                   ó€   — d Z ddlmZmZmZ ddlmZmZ ddlm	Z	 ddl
mZmZ ddlmZ  G d„ de«      Z G d	„ d
e	«      Zy)zœ
Tool for the AskNews API.

To use this tool, you must first set your credentials as environment variables:
    ASKNEWS_CLIENT_ID
    ASKNEWS_CLIENT_SECRET
é    )ÚAnyÚOptionalÚType)ÚAsyncCallbackManagerForToolRunÚCallbackManagerForToolRun)ÚBaseTool)Ú	BaseModelÚField)ÚAskNewsAPIWrapperc                   óR   — e Zd ZU dZ ed¬«      Zeed<    edd¬«      Ze	e
   ed<   y)	ÚSearchInputz"Input for the AskNews Search tool.zMSearch query to be used for finding real-time or historical news information.)ÚdescriptionÚqueryr   a  If the Assistant deems that the event may have occurred more than 48 hours ago, it estimates the number of hours back to search. For example, if the event was one month ago, the Assistant may set this to 720. One week would be 168. The Assistant can estimate up to on year back (8760).Ú
hours_backN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   ÚstrÚ__annotations__r   r   Úint© ó    úp/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/langchain_community/tools/asknews/tool.pyr   r      s;   … Ù,áðô€Eˆ3ó ñ !&Ø	ðWô!€J�˜‘ô r   r   c                   óÂ   — e Zd ZU dZdZeed<   dZeed<    ee	¬«      Z
e	ed<   dZeed	<   eZeee      ed
<   	 	 ddededee   dedef
d„Z	 	 ddededee   dedef
d„Zy)ÚAskNewsSearchz#Tool that searches the AskNews API.Úasknews_searchÚnamez´This tool allows you to perform a search on up-to-date news and historical news. If you needs news from more than 48 hours ago, you can estimate the number of hours back to search.r   )Údefault_factoryÚapi_wrapperé
   Úmax_resultsÚargs_schemaNr   r   Úrun_managerÚkwargsÚreturnc                 ó–   — 	 | j                   j                  ||| j                  ¬«      S # t        $ r}t	        |«      cY d}~S d}~ww xY w)zUse the tool.©r   r"   N)r    Úsearch_newsr"   Ú	ExceptionÚrepr©Úselfr   r   r$   r%   Úes         r   Ú_runzAskNewsSearch._run2   sO   € ð	Ø×#Ñ#×/Ñ/ØØ%Ø ×,Ñ,ð 0ó ð øô
 ò 	Ü˜“7�Nûð	ús   ‚'* ª	A³
A½AÁAc              ‹   ó²   K  — 	 | j                   j                  ||| j                  ¬«      ƒ d{  –—† S 7 Œ# t        $ r}t	        |«      cY d}~S d}~ww xY w­w)zUse the tool asynchronously.r(   N)r    Úasearch_newsr"   r*   r+   r,   s         r   Ú_arunzAskNewsSearch._arunC   s\   è ø€ ð	Ø×)Ñ)×6Ñ6ØØ%Ø ×,Ñ,ð 7ó ÷ ð ð ùô
 ò 	Ü˜“7�Nûð	üs<   ‚A„+6 ¯4°6 ³A´6 ¶	A¿
AÁ	AÁ
AÁAÁA)r   N)r   r   r   r   r   r   r   r   r
   r   r    r"   r   r   r#   r   r   r	   r   r   r/   r   r2   r   r   r   r   r   %   sÖ   … Ù-à €Dˆ#Ó ð	*ð �ó ñ
 &+Ð;LÔ%M€KÐ"ÓMØ€K�ÓØ-8€K�˜$˜y™/Ñ*Ó8ð
 Ø;?ñ	àðð ðð Ð7Ñ8ð	ð
 ðð 
óð( Ø@Dñ	àðð ðð Ð<Ñ=ð	ð
 ðð 
ôr   r   N)r   Útypingr   r   r   Úlangchain_core.callbacksr   r   Úlangchain_core.toolsr   Úpydanticr	   r
   Ú%langchain_community.utilities.asknewsr   r   r   r   r   r   Ú<module>r8      s:   ðñ÷ 'Ñ &÷õ *ß %å Cô�)ô ô -�Hõ -r   