Skip to content

Commit e09250b

Browse files
committed
patched return values on yfinance
1 parent 5b0d8d4 commit e09250b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/api_get_stock_prices_yfinance.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ async def search_stock_symbol(keyword):
5050
else:
5151
logging.info(f"Fallback candidate {best_candidate} has no history.")
5252
# 3) If we still don’t get a valid ticker, just bail out
53-
return "No matches found."
53+
# return "No matches found."
54+
55+
# 3) Or, rather, tell the user:
56+
return (
57+
"We were unable to find the ticker for the keyword you provided. "
58+
"You can tell the user (in their language) that you can use other tools (e.g., Perplexity API or a web search) "
59+
"to locate the correct ticker symbol for them."
60+
)
5461

5562
def yahoo_finance_search(query):
5663
"""

0 commit comments

Comments
 (0)