Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def market_sentiment_story(index: str) -> str:
|
|
| 14 |
Args:
|
| 15 |
index: One of 'sp500', 'dowjones', or 'nasdaq'.
|
| 16 |
"""
|
| 17 |
-
# 1. Map user input to Yahoo Finance symbols
|
| 18 |
symbols = {
|
| 19 |
"sp500": "^GSPC",
|
| 20 |
"dowjones": "^DJI",
|
|
@@ -23,8 +23,6 @@ def market_sentiment_story(index: str) -> str:
|
|
| 23 |
|
| 24 |
# 2. Get the correct symbol for the requested index
|
| 25 |
symbol = symbols.get(index.lower())
|
| 26 |
-
if not symbol:
|
| 27 |
-
return "Please choose one of: 'sp500', 'dowjones', or 'nasdaq'."
|
| 28 |
|
| 29 |
try:
|
| 30 |
# 3. Fetch data from Yahoo Finance
|
|
|
|
| 14 |
Args:
|
| 15 |
index: One of 'sp500', 'dowjones', or 'nasdaq'.
|
| 16 |
"""
|
| 17 |
+
# 1. Map user input to Yahoo Finance symbols (Can create another tool down the line)
|
| 18 |
symbols = {
|
| 19 |
"sp500": "^GSPC",
|
| 20 |
"dowjones": "^DJI",
|
|
|
|
| 23 |
|
| 24 |
# 2. Get the correct symbol for the requested index
|
| 25 |
symbol = symbols.get(index.lower())
|
|
|
|
|
|
|
| 26 |
|
| 27 |
try:
|
| 28 |
# 3. Fetch data from Yahoo Finance
|