Source code for langchain_community.tools.google_scholar.tool
"""Tool for the Google Scholar"""fromtypingimportOptionalfromlangchain_core.callbacksimportCallbackManagerForToolRunfromlangchain_core.toolsimportBaseToolfromlangchain_community.utilities.google_scholarimportGoogleScholarAPIWrapper
[docs]classGoogleScholarQueryRun(BaseTool):# type: ignore[override]"""Tool that queries the Google search API."""name:str="google_scholar"description:str=("A wrapper around Google Scholar Search. ""Useful for when you need to get information about""research papers from Google Scholar""Input should be a search query.")api_wrapper:GoogleScholarAPIWrapperdef_run(self,query:str,run_manager:Optional[CallbackManagerForToolRun]=None,)->str:"""Use the tool."""returnself.api_wrapper.run(query)