feat: Add YFinanceTool component for interacting with Yahoo Finance News (#2759)
* feat: add yfinance dependency to pyproject.toml * feat: Add YFinanceTool component for interacting with Yahoo Finance News * refactor: update YfinanceToolComponent to use type casting for Tool return value
This commit is contained in:
parent
d509c0a998
commit
50a64b0e0e
3 changed files with 150 additions and 6 deletions
20
src/backend/base/langflow/components/tools/YfinanceTool.py
Normal file
20
src/backend/base/langflow/components/tools/YfinanceTool.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from typing import cast
|
||||
|
||||
from langchain_community.tools.yahoo_finance_news import YahooFinanceNewsTool
|
||||
|
||||
from langflow.custom import Component
|
||||
from langflow.field_typing import Tool
|
||||
from langflow.io import Output
|
||||
|
||||
|
||||
class YfinanceToolComponent(Component):
|
||||
display_name = "Yahoo Finance News Tool"
|
||||
description = "Tool for interacting with Yahoo Finance News."
|
||||
name = "YFinanceTool"
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Tool", name="tool", method="build_tool"),
|
||||
]
|
||||
|
||||
def build_tool(self) -> Tool:
|
||||
return cast(Tool, YahooFinanceNewsTool())
|
||||
Loading…
Add table
Add a link
Reference in a new issue