diff --git a/llama-index-integrations/tools/llama-index-tools-finance/llama_index/tools/finance/base.py b/llama-index-integrations/tools/llama-index-tools-finance/llama_index/tools/finance/base.py index ea2aaf4084799de1564162c853a8778b5631c41d..d74e0177a91bccfffa25586f6d107ba66ec93ded 100644 --- a/llama-index-integrations/tools/llama-index-tools-finance/llama_index/tools/finance/base.py +++ b/llama-index-integrations/tools/llama-index-tools-finance/llama_index/tools/finance/base.py @@ -1,7 +1,7 @@ from typing import List, Optional, Any, Dict import pandas as pd - +from datetime import datetime, timedelta from llama_index.tools.finance import comparisons, earnings, news from llama_index.core.tools.tool_spec.base import BaseToolSpec @@ -142,7 +142,7 @@ class FinanceAgentToolSpec(BaseToolSpec): def get_latest_news_for_stock(self, stock_id: str) -> List[str]: """Given a stock_id representing the name of a company or the stock ticker symbol, Returns a list of news published related to top business articles in US in last 7 days from now.""" - articles = news.get_latest_news_for_stock(stock_id=stock_id) + articles = news.get_latest_news_for_stock(self._api_key, stock_id=stock_id) return [a["title"] for a in articles] def get_current_stock_price_info( diff --git a/llama-index-packs/llama-index-packs-finchat/README.md b/llama-index-packs/llama-index-packs-finchat/README.md index fda963f89b8d8518c29f0c177124ffcb72b60c21..87a1cb502da7fc0fd55b83704250bda8c4bf5c06 100644 --- a/llama-index-packs/llama-index-packs-finchat/README.md +++ b/llama-index-packs/llama-index-packs-finchat/README.md @@ -11,7 +11,7 @@ combine information to answer. ### Installation ```bash -pip install llama-index llama-index-tools-finchat +pip install llama-index llama-index-packs-finchat ``` ## CLI Usage