From 81cc4a194928096b3561839a732a05d4c0338c00 Mon Sep 17 00:00:00 2001 From: Ishan <345ishaan@gmail.com> Date: Fri, 8 Mar 2024 11:47:55 -0800 Subject: [PATCH] [BUG] llama-index-tools-finance (#11772) * fix bug * fix bug --- .../llama_index/tools/finance/base.py | 4 ++-- llama-index-packs/llama-index-packs-finchat/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 ea2aaf408..d74e0177a 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 fda963f89..87a1cb502 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 -- GitLab