From ddcec005bc162832fa7b08c08398fcc471ca7d89 Mon Sep 17 00:00:00 2001 From: Leonid Ganeline Date: Tue, 31 Oct 2023 14:58:09 -0700 Subject: [PATCH] fix for `YahooFinanceNewsTool` (#12665) Added YahooFinanceNewsTool to the __init__.py It was missed here. --- libs/langchain/langchain/tools/__init__.py | 23 +++++++++++++------ .../tests/unit_tests/tools/test_public_api.py | 11 +++++---- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/libs/langchain/langchain/tools/__init__.py b/libs/langchain/langchain/tools/__init__.py index 848a7e915c8..e9ebdc02773 100644 --- a/libs/langchain/langchain/tools/__init__.py +++ b/libs/langchain/langchain/tools/__init__.py @@ -634,6 +634,12 @@ def _import_wolfram_alpha_tool() -> Any: return WolframAlphaQueryRun +def _import_yahoo_finance_news() -> Any: + from langchain.tools.yahoo_finance_news import YahooFinanceNewsTool + + return YahooFinanceNewsTool + + def _import_youtube_search() -> Any: from langchain.tools.youtube.search import YouTubeSearchTool @@ -865,6 +871,8 @@ def __getattr__(name: str) -> Any: return _import_wikipedia_tool() elif name == "WolframAlphaQueryRun": return _import_wolfram_alpha_tool() + elif name == "YahooFinanceNewsTool": + return _import_yahoo_finance_news() elif name == "YouTubeSearchTool": return _import_youtube_search() elif name == "ZapierNLAListActions": @@ -897,6 +905,7 @@ __all__ = [ "BaseSQLDatabaseTool", "BaseSparkSQLTool", "BaseTool", + "BearlyInterpreterTool", "BingSearchResults", "BingSearchRun", "BraveSearch", @@ -906,13 +915,14 @@ __all__ = [ "DeleteFileTool", "DuckDuckGoSearchResults", "DuckDuckGoSearchRun", + "E2BDataAnalysisTool", "EdenAiExplicitImageTool", "EdenAiObjectDetectionTool", "EdenAiParsingIDTool", "EdenAiParsingInvoiceTool", - "EdenAiTextToSpeechTool", "EdenAiSpeechToTextTool", "EdenAiTextModerationTool", + "EdenAiTextToSpeechTool", "EdenaiTool", "ElevenLabsText2SpeechTool", "ExtractHyperlinksTool", @@ -946,12 +956,11 @@ __all__ = [ "MoveFileTool", "NavigateBackTool", "NavigateTool", + "O365CreateDraftMessage", "O365SearchEmails", "O365SearchEvents", - "O365CreateDraftMessage", - "O365SendMessage", "O365SendEvent", - "authenticate", + "O365SendMessage", "OpenAPISpec", "OpenWeatherMapQueryRun", "PubmedQueryRun", @@ -980,11 +989,11 @@ __all__ = [ "WikipediaQueryRun", "WolframAlphaQueryRun", "WriteFileTool", + "YahooFinanceNewsTool", "YouTubeSearchTool", "ZapierNLAListActions", "ZapierNLARunAction", - "tool", + "authenticate", "format_tool_to_openai_function", - "BearlyInterpreterTool", - "E2BDataAnalysisTool", + "tool", ] diff --git a/libs/langchain/tests/unit_tests/tools/test_public_api.py b/libs/langchain/tests/unit_tests/tools/test_public_api.py index ca675d591ae..9911ebb0128 100644 --- a/libs/langchain/tests/unit_tests/tools/test_public_api.py +++ b/libs/langchain/tests/unit_tests/tools/test_public_api.py @@ -19,6 +19,7 @@ _EXPECTED = [ "BaseSQLDatabaseTool", "BaseSparkSQLTool", "BaseTool", + "BearlyInterpreterTool", "BingSearchResults", "BingSearchRun", "BraveSearch", @@ -28,6 +29,7 @@ _EXPECTED = [ "DeleteFileTool", "DuckDuckGoSearchResults", "DuckDuckGoSearchRun", + "E2BDataAnalysisTool", "EdenAiExplicitImageTool", "EdenAiObjectDetectionTool", "EdenAiParsingIDTool", @@ -68,12 +70,11 @@ _EXPECTED = [ "MoveFileTool", "NavigateBackTool", "NavigateTool", + "O365CreateDraftMessage", "O365SearchEmails", "O365SearchEvents", - "O365CreateDraftMessage", - "O365SendMessage", "O365SendEvent", - "authenticate", + "O365SendMessage", "OpenAPISpec", "OpenWeatherMapQueryRun", "PubmedQueryRun", @@ -102,13 +103,13 @@ _EXPECTED = [ "WikipediaQueryRun", "WolframAlphaQueryRun", "WriteFileTool", + "YahooFinanceNewsTool", "YouTubeSearchTool", "ZapierNLAListActions", "ZapierNLARunAction", + "authenticate", "format_tool_to_openai_function", "tool", - "BearlyInterpreterTool", - "E2BDataAnalysisTool", ]