Spaces:
Build error
A newer version of the Gradio SDK is available:
5.49.1
title: FinRobot-claude-4.1-opus
emoji: π€
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.47.0
app_file: app1 - claude-4.1-opus.py
python_version: 3.12
pinned: false
license: apache-2.0
short_description: AI-powered stock market analysis
π€ FinRobot Forecaster
AI-powered stock market analysis and prediction using advanced language models
This application provides comprehensive stock market analysis by combining:
- Real-time stock data from Alpha Vantage via RapidAPI (premium access)
- Company news and sentiment from Finnhub
- Advanced AI analysis using Google's Gemini models
- Financial metrics and historical performance data
π Features
- Stock Price Analysis: Analyze historical price movements over configurable time periods
- News Sentiment Analysis: Process company news and market sentiment
- AI-Powered Predictions: Generate detailed market outlook using advanced language models
- Financial Metrics: Optional inclusion of basic financial data
- Interactive Interface: User-friendly Gradio interface for easy interaction
π How It Works
- Data Collection: Fetches historical stock data and recent company news
- Analysis: Processes the data to identify trends and patterns
- AI Processing: Uses Google Gemini to analyze the information
- Prediction: Generates structured predictions with:
- Positive developments
- Potential concerns
- Price outlook with rationale
π οΈ Setup Instructions
For HuggingFace Spaces:
- Fork this repository to your HuggingFace account
- Deploy: The Space will automatically build and deploy
- All API keys are already included in the code
- Multiple API keys are used for better reliability and rate limit handling
For Local Development:
Clone the repository:
git clone <your-repo-url> cd finrobot-forecasterInstall dependencies:
pip install -r requirements.txtRun the application:
python app.py
π Usage Examples
Try these popular stocks:
- AAPL (Apple Inc.)
- MSFT (Microsoft Corporation)
- GOOGL (Alphabet Inc.)
- TSLA (Tesla Inc.)
- NVDA (NVIDIA Corporation)
βοΈ Configuration Options
- Stock Symbol: Enter any valid ticker symbol
- Historical Weeks: Choose 1-6 weeks of historical data
- Basic Financials: Toggle to include financial metrics
π§ Technical Details
- Framework: Gradio 5.46.0
- AI Model: Google Gemini 1.5 Pro
- Data Sources: RapidAPI Alpha Vantage (2 premium keys), Finnhub
- Language: Python 3.11
- Container: Optimized for HuggingFace Spaces
π Output Format
The AI analysis provides:
[Positive Developments]
- Key positive factors affecting the stock
- Recent achievements and growth indicators
[Potential Concerns]
- Risk factors and challenges
- Market uncertainties
[Prediction & Analysis]
- One-week price outlook
- Detailed rationale for the prediction
π‘οΈ Error Handling & Reliability
Comprehensive Fallback System:
- Primary: RapidAPI Alpha Vantage (2 premium keys with rotation)
- Secondary: Mock data generation (for demonstration)
API Key Rotation:
- Automatic switching between RapidAPI keys
- Rate limit detection with seamless fallback
- Comprehensive logging for debugging
- Graceful degradation at every level
Error Recovery:
- Timeout handling: 30-second timeout with retry logic
- Rate limit management: Automatic key rotation
- Mock data fallback: App always works for demonstration
- User-friendly messages: Clear error communication
β οΈ Disclaimer
Important: This application is for educational and research purposes only. The predictions and analysis provided should not be considered as financial advice. Always consult with qualified financial professionals before making investment decisions.
π€ Contributing
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
π License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
π Acknowledgments
- FinRobot - Original FinRobot framework
- Google AI - Gemini models
- [RAPID] - Stock market data
- Finnhub - Financial news and data
- Gradio - Web interface framework
Built with β€οΈ for the financial AI community