
    dh/                     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 Serper.dev Google Search API.    )Optional)AsyncCallbackManagerForToolRunCallbackManagerForToolRun)BaseTool)Field)GoogleSerperAPIWrapperc                       \ 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)GoogleSerperRun   z3Tool that queries the Serper.dev Google search API.google_serpernamez~A low-cost Google Search API.Useful for when you need to answer questions about current events.Input should be a search query.descriptionapi_wrapperNqueryrun_managerreturnc                 J    [        U R                  R                  U5      5      $ zUse the tool.)strr   runselfr   r   s      d/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/tools/google_serper/tool.py_runGoogleSerperRun._run   s      4##''.//    c                 p   #    U R                   R                  U5      I Sh  vN R                  5       $  N7fzUse the tool asynchronously.N)r   arun__str__r   s      r   _arunGoogleSerperRun._arun"   s-      &&++E22;;==2   646 N)__name__
__module____qualname____firstlineno____doc__r   r   __annotations__r   r   r   r   r   r   r!   __static_attributes__r$   r   r   r
   r
      s    =D#	*  
 ('
 <@00 780 
	0 AE>> <=> 
	> >r   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	)GoogleSerperResults+   zETool that queries the Serper.dev Google Search API
and get back json.google_serper_results_jsonr   zA low-cost Google Search API.Useful for when you need to answer questions about current events.Input should be a search query. Output is a JSON object of the query resultsr   )default_factoryr   Nr   r   r   c                 J    [        U R                  R                  U5      5      $ r   )r   r   resultsr   s      r   r   GoogleSerperResults._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   aresultsr    r   s      r   r!   GoogleSerperResults._arun?   s-      &&//66??AA6r#   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     -D#,	W  
 +0@V*WK'W
 <@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.google_serperr   r
   r.   r$   r   r   <module>r=      s5    0  *  N>h >8B( Br   