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