U
    h                     @   sl   d 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 )z!Tool for the SemanticScholar API.    )OptionalType)CallbackManagerForToolRun)	BaseModelField)BaseTool)SemanticScholarAPIWrapperc                   @   s$   e Zd ZU dZeddZeed< dS )SemantscholarInputz#Input for the SemanticScholar tool.zsearch query to look up)descriptionqueryN)__name__
__module____qualname____doc__r   r   str__annotations__ r   r   R/tmp/pip-unpacked-wheel-9gdii04g/langchain_community/tools/semanticscholar/tool.pyr	      s   
r	   c                   @   sd   e Zd ZU dZdZeed< dZeed< ee	dZ
e	ed< eZee ed< deee ed
ddZd	S )SemanticScholarQueryRunz+Tool that searches the semanticscholar API.ZsemanticscholarnamezA wrapper around semantischolar.org Useful for when you need to answer to questionsfrom research papers.Input should be a search query.r
   )default_factoryapi_wrapperargs_schemaN)r   run_managerreturnc                 C   s   | j |S )zUse the Semantic Scholar tool.)r   run)selfr   r   r   r   r   _run!   s    zSemanticScholarQueryRun._run)N)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)r   typingr   r   Zlangchain_core.callbacksr   Zlangchain_core.pydantic_v1r   r   Zlangchain_core.toolsr   Z-langchain_community.utilities.semanticscholarr   r	   r   r   r   r   r   <module>   s   