U
    hU                     @   s|   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 d dlmZ G dd de
ZG d	d
 d
eZdS )    )ListOptionalType)AsyncCallbackManagerForToolRunCallbackManagerForToolRun)Document)	BaseModelField)BaseTool)YouSearchAPIWrapperc                   @   s$   e Zd ZU dZeddZeed< dS )YouInputz"Input schema for the you.com tool.zshould be a search query)descriptionqueryN)__name__
__module____qualname____doc__r	   r   str__annotations__ r   r   F/tmp/pip-unpacked-wheel-9gdii04g/langchain_community/tools/you/tool.pyr      s   
r   c                   @   s   e Zd ZU dZdZeed< dZeed< eZ	e
e ed< eedZeed< deee ee d
ddZdeee ee d
ddZd	S )YouSearchToolz#Tool that searches the you.com API.Z
you_searchnamez`The YOU APIs make LLMs and search experiences more factual andup to date with realtime web data.r   args_schema)default_factoryapi_wrapperN)r   run_managerreturnc                 C   s   | j |S )zUse the you.com tool.)r   resultsselfr   r   r   r   r   _run   s    zYouSearchTool._runc                    s   | j |I dH S )z$Use the you.com tool asynchronously.N)r   Zresults_asyncr   r   r   r   _arun'   s    zYouSearchTool._arun)N)N)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   r   r      s$   

  r   N)typingr   r   r   Zlangchain_core.callbacksr   r   Zlangchain_core.documentsr   Zlangchain_core.pydantic_v1r   r	   Zlangchain_core.toolsr
   Z!langchain_community.utilities.your   r   r   r   r   r   r   <module>   s   