Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAlpha VantageApifyArXivAWS LambdaShell (bash)Bearly Code InterpreterBing SearchBrave SearchChatGPT PluginsDall-E Image GeneratorDataForSeoDuckDuckGo SearchEden AIEleven Labs Text2SpeechFile SystemGolden QueryGoogle DriveGoogle PlacesGoogle SearchGoogle SerperGradioGraphQLHuggingFace Hub ToolsHuman as a toolIFTTT WebHooksLemon AgentMetaphor SearchNuclia UnderstandingOpenWeatherMapPubMedRequestsSceneXplainSearch ToolsSearchApiSearxNG SearchSerpAPITwilioWikipediaWolfram AlphaYahoo Finance NewsYouTubeZapier Natural Language ActionsAgents and toolkitsMemoryCallbacksChat loadersComponentsToolsYahoo Finance NewsOn this pageYahoo Finance NewsThis notebook goes over how to use the yahoo_finance_news tool with an agent. Setting up‚ÄãFirst, you need to install yfinance python package.pip install yfinanceExample with Chain‚Äãimport osos.environ["OPENAI_API_KEY"] = "..."from langchain.chat_models import ChatOpenAIfrom langchain.agents import initialize_agent, AgentTypefrom langchain.tools.yahoo_finance_news import YahooFinanceNewsTool llm = ChatOpenAI(temperature=0.0)tools = [YahooFinanceNewsTool()]agent_chain = initialize_agent(    tools,    llm,    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,    verbose=True,)agent_chain.run(    "What happens today with Microsoft stocks?",)            > Entering new AgentExecutor chain...    I should check the latest financial news about Microsoft stocks.    Action: yahoo_finance_news    Action Input: MSFT    Observation: Microsoft (MSFT) Gains But Lags Market: What You Should Know    In the latest trading session, Microsoft (MSFT) closed at $328.79, marking a +0.12% move from the previous day.    Thought:I have the latest information on Microsoft stocks.    Final
This notebook goes over how to use the yahoofinancenews tool with an agent.
This notebook goes over how to use the yahoofinancenews tool with an agent. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAlpha VantageApifyArXivAWS LambdaShell (bash)Bearly Code InterpreterBing SearchBrave SearchChatGPT PluginsDall-E Image GeneratorDataForSeoDuckDuckGo SearchEden AIEleven Labs Text2SpeechFile SystemGolden QueryGoogle DriveGoogle PlacesGoogle SearchGoogle SerperGradioGraphQLHuggingFace Hub ToolsHuman as a toolIFTTT WebHooksLemon AgentMetaphor SearchNuclia UnderstandingOpenWeatherMapPubMedRequestsSceneXplainSearch ToolsSearchApiSearxNG SearchSerpAPITwilioWikipediaWolfram AlphaYahoo Finance NewsYouTubeZapier Natural Language ActionsAgents and toolkitsMemoryCallbacksChat loadersComponentsToolsYahoo Finance NewsOn this pageYahoo Finance NewsThis notebook goes over how to use the yahoo_finance_news tool with an agent. Setting up‚ÄãFirst, you need to install yfinance python package.pip install yfinanceExample with Chain‚Äãimport osos.environ["OPENAI_API_KEY"] = "..."from langchain.chat_models import ChatOpenAIfrom langchain.agents import initialize_agent, AgentTypefrom langchain.tools.yahoo_finance_news import YahooFinanceNewsTool llm = ChatOpenAI(temperature=0.0)tools = [YahooFinanceNewsTool()]agent_chain = initialize_agent(    tools,    llm,    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,    verbose=True,)agent_chain.run(    "What happens today with Microsoft stocks?",)            > Entering new AgentExecutor chain...    I should check the latest financial news about Microsoft stocks.    Action: yahoo_finance_news    Action Input: MSFT    Observation: Microsoft (MSFT) Gains But Lags Market: What You Should Know    In the latest trading session, Microsoft (MSFT) closed at $328.79, marking a +0.12% move from the previous day.    Thought:I have the latest information on Microsoft stocks.    Final