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