Spaces:
Sleeping
A newer version of the Gradio SDK is available:
5.45.0
title: Weather App
emoji: π€οΈ
colorFrom: gray
colorTo: blue
sdk: gradio
sdk_version: 5.33.0
app_file: app.py
pinned: false
agent-demo-track
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
agent-demo-track
πΉ Video Overview
Watch our video overview to learn about the app's features and how to get the most out of the AI-powered weather assistant.
Weather Data Processing Flow: Visualizing how data moves through the system, from acquisition to user presentation
System Architecture: Illustrating the integration between LlamaIndex, Gemini API, and the weather data processing components
π€οΈ Weather App Pro Enhanced - Complete Package
π NEW: Full AI Integration with LlamaIndex & Gemini!
This is the COMPLETE Weather App Pro package with full LLM integration for intelligent weather conversations.
π€ Enhanced AI Features
LlamaIndex Integration
- Document Understanding: Advanced context processing
- Memory Management: Maintains conversation context
- Vector Search: Intelligent information retrieval
- Chat Engine: Sophisticated conversation handling
Gemini API Integration
- Google's Gemini Pro: State-of-the-art language model
- Natural Conversations: Human-like weather discussions
- Smart Responses: Context-aware and informative
- Fallback System: Works even without API key
π Conversational Weather Intelligence
- Activity Advice: "Should I go biking in Seattle?" - Get weather-based recommendations
- Forecast Queries: Natural language forecast requests with timeline awareness
- Historical Comparisons: "How does today compare to normal?" context
- Safety Considerations: Intelligent warnings for outdoor activities
- Multi-City Analysis: Smart comparisons between locations
- Personalized Responses: Context-aware advice for your specific needs
π See CONVERSATIONAL_FEATURES.md for detailed examples and usage guide
π Complete Project Structure
weather_app_complete/
βββ enhanced_main.py # π Enhanced app with full AI
βββ app.py # Standalone version (Hugging Face ready)
βββ main.py # Basic modular version
βββ requirements.txt # Updated with LlamaIndex & Gemini
βββ run_enhanced.sh # π Enhanced quick start script
βββ run.sh # Basic quick start (Linux/Mac)
βββ run.bat # Basic quick start (Windows)
βββ README.md # This comprehensive guide
βββ INSTALLATION.md # Detailed setup instructions
βββ src/ # Complete modular architecture
β βββ __init__.py
β βββ ai/ # Multi-AI provider system
β β βββ __init__.py
β β βββ multi_provider.py
β βββ analysis/ # Climate analysis & ML
β β βββ __init__.py
β β βββ climate_analyzer.py
β βββ api/ # Advanced weather API client
β β βββ __init__.py
β β βββ weather_client.py
β βββ chatbot/ # π Enhanced chatbot system
β β βββ __init__.py
β β βββ nlp_processor.py
β β βββ enhanced_chatbot.py # π Full LLM integration
β βββ geovisor/ # Interactive maps & visualization
β β βββ __init__.py
β β βββ map_manager.py
β βββ mcp_server/ # MCP protocol support
β β βββ __init__.py
β βββ utils/ # Utility functions
β βββ __init__.py
βββ static/ # Static assets
βββ templates/ # HTML templates
βββ data/ # Data storage
βββ logs/ # Application logs
π Quick Start Options
Option 1: Enhanced AI Version (Recommended)
# Extract the package
tar -xzf weather_app_complete_ENHANCED.tar.gz
cd weather_app_complete
# Set Gemini API key for full AI features
export GEMINI_API_KEY="your-gemini-api-key"
# Run enhanced version
./run_enhanced.sh
Option 2: Standalone Version (Hugging Face)
# For Hugging Face Spaces deployment
python app.py
Option 3: Basic Modular Version
# Basic version without advanced AI
./run.sh
π€ AI Configuration
Gemini API Key (Recommended)
# Get your free API key from: https://makersuite.google.com/app/apikey
export GEMINI_API_KEY="your-gemini-api-key-here"
Optional: Additional AI Providers
export OPENAI_API_KEY="your-openai-key"
export CLAUDE_API_KEY="your-claude-key"
π¬ Enhanced Conversation Examples
The AI now provides intelligent, contextual responses:
Simple Query
User: "What's the temperature in Wichita?" AI: "The current temperature in Wichita is 72Β°F with partly cloudy skies. It's a pleasant day with light winds from the southwest at 8 mph. The humidity is comfortable at 45%, making it feel quite nice outside. Perfect weather for outdoor activities!"
Comparison Query
User: "Compare rain in New York and Miami" AI: "Great question! Looking at the current conditions:
π½ New York: 15% chance of rain, mostly sunny with 68Β°F ποΈ Miami: 65% chance of rain, scattered thunderstorms with 82Β°F
Miami has a significantly higher chance of precipitation today - about 50% more likely than New York. This is typical for Miami's subtropical climate, especially during summer months when afternoon thunderstorms are common. New York is experiencing a drier weather pattern today with high pressure dominating the region."
Complex Analysis
User: "Should I plan outdoor activities in Denver this weekend?" AI: "Based on Denver's weekend forecast, here's my recommendation:
Saturday: Excellent for outdoor activities! 75Β°F, sunny skies, light winds. Perfect hiking or biking weather.
Sunday: Plan indoor alternatives. 30% chance of afternoon thunderstorms, temperatures dropping to 65Β°F with gusty winds up to 25 mph.
Recommendation: Schedule your outdoor activities for Saturday morning through early afternoon. If you must be outside Sunday, plan for earlier in the day before the storm system moves in around 2 PM."
π Key Enhancements
π§ Intelligent Responses
- Context Awareness: Remembers conversation history
- Weather Expertise: Trained on meteorological knowledge
- Practical Advice: Offers actionable recommendations
- Natural Language: Human-like conversation flow
πΊοΈ Dynamic Map Integration
- Auto-Focus: Map zooms to mentioned cities automatically
- Smart Markers: Rich weather information in popups
- Comparison Lines: Visual connections between compared cities
- Weather Layers: Precipitation radar and overlays
π Advanced Analytics
- Real-time Processing: Instant weather data analysis
- Trend Recognition: Identifies weather patterns
- Anomaly Detection: Highlights unusual conditions
- Predictive Insights: Future weather implications
π§ Technical Features
LlamaIndex Integration
- Vector Store: Efficient weather knowledge retrieval
- Chat Memory: Maintains conversation context
- Document Processing: Weather data understanding
- Query Engine: Intelligent information synthesis
Gemini API Features
- Advanced NLP: Superior language understanding
- Context Retention: Multi-turn conversations
- Weather Expertise: Domain-specific knowledge
- Error Handling: Graceful fallback mechanisms
Robust Architecture
- Modular Design: Clean, maintainable code
- Error Recovery: Handles API failures gracefully
- Performance Optimized: Fast response times
- Scalable: Ready for production deployment
π± Deployment Options
Hugging Face Spaces
- Upload
app.py
andrequirements.txt
- Add
GEMINI_API_KEY
in Space settings - Select Gradio SDK
- Auto-deploys with full AI features!
Local Development
pip install -r requirements.txt
export GEMINI_API_KEY="your-key"
python enhanced_main.py
Docker Deployment
FROM python:3.9
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
ENV GEMINI_API_KEY="your-key"
CMD ["python", "enhanced_main.py"]
π Troubleshooting
AI Features Not Working
- Verify Gemini API key is set correctly
- Check internet connection
- Ensure API key has proper permissions
- App works in basic mode without API key
Import Errors
- Install all requirements:
pip install -r requirements.txt
- Check Python version (3.7+ required)
- Verify all files are in correct structure
Performance Issues
- Ensure stable internet connection
- Check system resources (512MB RAM minimum)
- Try basic version if enhanced is slow
π What's New in Enhanced Version
β
Full LlamaIndex Integration - Advanced AI framework
β
Gemini API Integration - Google's powerful LLM
β
Intelligent Conversations - Context-aware responses
β
Enhanced NLP - Better query understanding
β
Memory Management - Conversation history retention
β
Weather Expertise - Domain-specific knowledge
β
Fallback Systems - Works without API keys
β
Performance Optimized - Fast, efficient processing
π The Most Advanced Weather Intelligence Platform
Complete AI integration with LlamaIndex & Gemini for truly intelligent weather conversations!