Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,711 Bytes
5a50d7c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# Configuration settings for the stock forecasting app
# Rate limiting settings
RATE_LIMIT_DELAY = 0.5 # Minimum delay between API calls (seconds)
MAX_RETRIES = 3 # Maximum number of retries for failed requests
BASE_RETRY_DELAY = 3 # Base delay for exponential backoff (seconds)
# Cache settings
DEFAULT_CACHE_TTL = 300 # Default cache time-to-live (seconds) - 5 minutes
MODEL_CACHE_TTL = 600 # Cache TTL for model data (seconds) - 10 minutes
# API settings
YAHOO_FINANCE_TIMEOUT = 10 # Timeout for yfinance requests (seconds)
# UI settings
DEFAULT_TICKERS = ['NVDA', 'AAPL', 'GOOGL', 'MSFT', 'AMZN']
PERIOD_MAP = {
'all': 'max',
'1m': '1mo',
'6m': '6mo',
'1y': '1y'
}
# Error messages
ERROR_MESSAGES = {
'rate_limit': """
🚫 **Rate Limit Exceeded**
Yahoo Finance has temporarily limited your requests. This happens when too many requests are made in a short time.
**What you can do:**
- Wait 5-10 minutes before trying again
- Use the cached data if available
- Try a different stock ticker
The app will automatically retry with delays between requests.
""",
'network': """
🌐 **Network Error**
There seems to be a connectivity issue.
**What you can do:**
- Check your internet connection
- Try refreshing the page
- Wait a moment and try again
""",
'no_data': """
📊 **No Data Available**
No stock data was found for the selected ticker and time period.
**What you can do:**
- Try a different time period
- Check if the ticker symbol is correct
- Try a different stock ticker
"""
} |