o
    Zh                     @   sl   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ G dd de	ZG d	d
 d
eZdS )zTool for the Wikipedia API.    )OptionalType)CallbackManagerForToolRun)BaseTool)	BaseModelField)WikipediaAPIWrapperc                   @   s$   e Zd ZU dZeddZeed< dS )WikipediaQueryInputz"Input for the WikipediaQuery tool.zquery to look up on wikipedia)descriptionqueryN)__name__
__module____qualname____doc__r   r   str__annotations__ r   r   _/var/www/html/lang_env/lib/python3.10/site-packages/langchain_community/tools/wikipedia/tool.pyr	      s   
 r	   c                   @   s`   e Zd ZU dZdZeed< dZeed< eed< e	Z
ee ed< 	dd	ed
ee defddZdS )WikipediaQueryRunz%Tool that searches the Wikipedia API.Z	wikipedianamezA wrapper around Wikipedia. Useful for when you need to answer general questions about people, places, companies, facts, historical events, or other subjects. Input should be a search query.r
   api_wrapperargs_schemaNr   run_managerreturnc                 C   s   | j |S )zUse the Wikipedia tool.)r   run)selfr   r   r   r   r   _run    s   zWikipediaQueryRun._run)N)r   r   r   r   r   r   r   r
   r   r	   r   r   r   r   r   r   r   r   r   r   r      s   
 
r   N)r   typingr   r   Zlangchain_core.callbacksr   Zlangchain_core.toolsr   Zpydanticr   r   Z'langchain_community.utilities.wikipediar   r	   r   r   r   r   r   <module>   s    