Spaces:
Running
Running
File size: 2,391 Bytes
fb856e1 |
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 |
# Weather Tool – Personal Assistant with Weather Integration
Created by [Ayaz Somani](https://www.linkedin.com/in/ayazs) as a community contribution.
## Overview
This Weather Tool community contribution gives the personal assistant chatbot the ability to discuss weather casually and contextually. It integrates real-time weather data from the Open-Meteo API, allowing the assistant to respond naturally to weather-related topics.
The assistant can reference weather in its current (simulated) location, the user’s location (if mentioned), or any other city brought up in conversation. This builds a more engaging, humanlike interaction while preserving the assistant’s focus on personal and professional topics defined in the `me` folder.
## Features
### New Capabilities
- **Real-Time Weather Updates** | Seamless integration with Open-Meteo’s API
- **Natural Weather Mentions** | Assistant introduces weather organically during conversation, not just in response to questions
### Technical Enhancements
- **Location Resolution** | Uses Open-Meteo’s geocoding API to convert place names to coordinates
- **Weather Lookup** | Fetches current temperature, conditions, and other data from Open-Meteo
## File Structure
weather-tool/
├── app.py # Main application
├── requirements.txt # Python dependencies
└── me/ # Required dependency for the app to run
## Environment Variables
The following variable is required to personalize assistant responses:
- `BOT_SELF_NAME` – Name the assistant uses to refer to itself (e.g. "Ed", "Alex", etc.)
## Getting Started
1. Install dependencies:
```bash
uv add openmeteo_requests
## Getting Started
1. Install dependencies:
```bash
uv add openmeteo_requests
```
2. Set the necessary environment variables in `.env`, including:
```text
BOT_SELF_NAME=YourAssistantName
```
3. Add your personal files to the me/ directory:
- linkedin.pdf
- summary.txt
4. Launch the application:
```bash
uv run app.py
```
5. Open the Gradio interface in your browser to start interacting with the assistant.
## Try These Example Prompts
To test the weather functionality in context, try saying:
- “What’s the weather like where you are today?”
- “I’m heading to London. Wonder if I need an umbrella?”
- “Is it really snowing in Calgary right now?”
|