lethaq commited on
Commit
88e14d0
·
verified ·
1 Parent(s): 9422319

Update app.py

Browse files

Added the function of searching recommended books, including fiction, history, and romance

Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -49,16 +49,8 @@ def get_something_to_read(booksname:srt) -> str:
49
  else:
50
  all_books: List[str] = fiction_books + history_books + romance_books
51
  return random.choice(all_books)
52
- @tool
53
- import yfinance as yf
54
- def get_today_us_stock_price(ticker_symbol: str) -> str:
55
- try:
56
- stock = yf.Ticker(ticker_symbol)
57
- today_data = stock.history(period="1d")
58
- close_price = today_data['close'].iloc[-1]
59
- return f"The today's closing price of {ticker_symbol} is: ${close_price}"
60
- except Exception as e:
61
- return f"Error fetching stock price for {ticker_symbol}: {str(e)}"
62
 
63
 
64
  final_answer = FinalAnswerTool()
 
49
  else:
50
  all_books: List[str] = fiction_books + history_books + romance_books
51
  return random.choice(all_books)
52
+
53
+
 
 
 
 
 
 
 
 
54
 
55
 
56
  final_answer = FinalAnswerTool()