Spaces:
Sleeping
Sleeping
File size: 10,088 Bytes
0652394 a6c545f 0652394 a6c545f 0652394 a6c545f 0652394 a6c545f e5b47fa c251732 7570791 afb6ed3 |
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
---
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
[](https://www.youtube.com/watch?v=2F2jrSrjy20)
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](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)**
```bash
# 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)**
```bash
# For Hugging Face Spaces deployment
python app.py
```
### **Option 3: Basic Modular Version**
```bash
# Basic version without advanced AI
./run.sh
```
## π€ **AI Configuration**
### **Gemini API Key (Recommended)**
```bash
# 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**
```bash
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**
1. Upload `app.py` and `requirements.txt`
2. Add `GEMINI_API_KEY` in Space settings
3. Select Gradio SDK
4. Auto-deploys with full AI features!
### **Local Development**
```bash
pip install -r requirements.txt
export GEMINI_API_KEY="your-key"
python enhanced_main.py
```
### **Docker Deployment**
```dockerfile
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**
1. Verify Gemini API key is set correctly
2. Check internet connection
3. Ensure API key has proper permissions
4. App works in basic mode without API key
### **Import Errors**
1. Install all requirements: `pip install -r requirements.txt`
2. Check Python version (3.7+ required)
3. Verify all files are in correct structure
### **Performance Issues**
1. Ensure stable internet connection
2. Check system resources (512MB RAM minimum)
3. 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!*
|