
    dh0                     t    S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	  SSK
Jr   " S S\5      r " S	 S
\5      rg)z%Tool for the SearchApi.io search API.    )Optional)AsyncCallbackManagerForToolRunCallbackManagerForToolRun)BaseTool)Field)SearchApiAPIWrapperc                       \ rS rSr% SrSr\\S'   Sr\\S'   \	\S'    SS	\S
\
\   S\4S jjr SS	\S
\
\   S\4S jjrSrg)SearchAPIRun   z.Tool that queries the SearchApi.io search API.	searchapinamezGoogle search API provided by SearchApi.io.This tool is handy when you need to answer questions about current events.Input should be a search query.descriptionapi_wrapperNqueryrun_managerreturnc                 8    U R                   R                  U5      $ zUse the tool.)r   runselfr   r   s      `/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/tools/searchapi/tool.py_runSearchAPIRun._run   s     ##E**    c                 T   #    U R                   R                  U5      I Sh  vN $  N7fzUse the tool asynchronously.N)r   arunr   s      r   _arunSearchAPIRun._arun"   s$      %%**51111s   (&( N)__name__
__module____qualname____firstlineno____doc__r   str__annotations__r   r   r   r   r   r   r   __static_attributes__r!   r   r   r
   r
      s    8D#	*  
 %$
 <@++ 78+ 
	+ AE22 <=2 
	2 2r   r
   c                       \ rS rSr% SrSr\\S'   Sr\\S'   \	" \
S9r\
\S'    SS
\S\\   S\4S jjr SS
\S\\   S\4S jjrSrg	)SearchAPIResults+   z?Tool that queries the SearchApi.io search API and returns JSON.searchapi_results_jsonr   zGoogle search API provided by SearchApi.io.This tool is handy when you need to answer questions about current events.The input should be a search query and the output is a JSON object with the query results.r   )default_factoryr   Nr   r   r   c                 J    [        U R                  R                  U5      5      $ r   )r(   r   resultsr   s      r   r   SearchAPIResults._run7   s      4##++E233r   c                 p   #    U R                   R                  U5      I Sh  vN R                  5       $  N7fr   )r   aresults__str__r   s      r   r   SearchAPIResults._arun?   s-      &&//66??AA6s   646r!   r"   )r#   r$   r%   r&   r'   r   r(   r)   r   r   r   r   r   r   r   r   r   r*   r!   r   r   r,   r,   +   s    I(D#(	"   (-=P'QK$Q
 <@44 784 
	4 AEBB <=B 
	B Br   r,   N)r'   typingr   langchain_core.callbacksr   r   langchain_core.toolsr   pydanticr   'langchain_community.utilities.searchapir   r
   r,   r!   r   r   <module>r<      s5    +  *  G28 28Bx Br   