
    7|h                     x    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e	      Z G d	 d
e      Zy)z!Tool for the SemanticScholar API.    )OptionalType)CallbackManagerForToolRun)BaseTool)	BaseModelField)SemanticScholarAPIWrapperc                   .    e Zd ZU dZ ed      Zeed<   y)SemantscholarInputz#Input for the SemanticScholar tool.zsearch query to look up)descriptionqueryN)__name__
__module____qualname____doc__r   r   str__annotations__     m/var/www/html/test/engine/venv/lib/python3.12/site-packages/langchain_community/tools/semanticscholar/tool.pyr   r      s    -#<=E3=r   r   c                   |    e Zd ZU dZdZeed<   dZeed<    ee	      Z
e	ed<   eZee   ed<   	 dd
edee   defdZy	)SemanticScholarQueryRunz+Tool that searches the semanticscholar API.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_schemaNr   run_managerreturnc                 8    | j                   j                  |      S )zUse the Semantic Scholar tool.)r   run)selfr   r   s      r   _runzSemanticScholarQueryRun._run!   s     ##E**r   )N)r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r#   r   r   r   r   r      st    5!D#!	*   .31.K*  $6Ki5
 <@++ 78+ 
	+r   r   N)r   typingr   r   langchain_core.callbacksr   langchain_core.toolsr   pydanticr   r   -langchain_community.utilities.semanticscholarr	   r   r   r   r   r   <module>r)      s/    ' ! > ) % S> >+h +r   