A smart weather assistant powered by GPT Function Calling and OpenWeather API.
It suggests what to wear, do, and prepare for — all based on real-time and forecasted weather data.
- ✨ GPT with Function Calling
- 🌍 Real-time & 7-day weather forecasts
- 👕 Outfit suggestions with emojis
- 🏞️ Activity planning tips
⚠️ Weather warnings and preparation advice- 🖥️ Streamlit-based UI with selectable assistant variants (default, emoji, detailed)
- LLM: OpenAI GPT (
gpt-4orgpt-4o) - Weather API: Weather API (current & forecast)
- Frontend: Streamlit
- Backend: Python, OpenAI Function Calling
- Logging: Python
loggingmodule - Structure:
. ├── assets/ # Images, icons or static files ├── logs/ # Application logs ├── scripts/ # CLI scripts for quality checks or launching ├── src/ │ ├── services/ # Service-level logic (TBD) │ ├── tools/ # Tool calling: weather fetch, GPT call │ └── gpt_call.py # GPT call ├── utils/ # Constants, formatter, logging, prompt initializer ├── .env.example # Sample environment config ├── app.py # Streamlit entrypoint └── README.md
# 1) Virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 2) Dependencies
pip install -r requirements.txt
# 3) Environment variables (optional but recommended)
cp .env.example .env
# Add your OPENAI_API_KEY and WEATHER_API_KEY to .env
# 4) Run the app
streamlit run app.py
# or
bash scripts/run.shFrom .env.example:
OPENAI_API_KEY=your_api_key_here
DEFAULT_MODEL=gpt-4o-mini
# Logging (optional)
LOG_LEVEL=INFO
LOG_TO_CONSOLE=1
LOG_FILE=app.log
LOG_MAX_BYTES=1000000
LOG_BACKUPS=3
LOG_FORMAT=%(asctime)s | %(levelname)s | %(name)s | %(message)s
LOG_DATEFMT=%Y-%m-%d %H:%M:%S
WEATHER_API_KEY=your_weather_api_key- Logging configuration is fully adjustable via environment variables.
# One command for all checks:
bash scripts/quality.sh
# Or manually:
ruff check . --fix
black . --line-length 100
pylint $(git ls-files '*.py' | tr '\n' ' ')
pytest -q
ruff→ fast linter,black→ formatting,pylint→ deep analysis,pytest→ tests.
| Variant | Example |
|---|---|
| Emoji 😎 | Suggests outfit + activity + warning with icons |
| Default 💬 | Text-based assistant style |
| Detailed 📚 | Full explanation and safety tips |
| Short 🧾 | Gives concise outfit and activity suggestions |
🧩 You can choose both the OpenAI model and the assistant variant (e.g., Emoji, Detailed, Short) from the sidebar.
The assistant will respond accordingly based on your selections.
🧹 Clear Conversation to reset the assistant’s memory and start fresh
This project is licensed under the MIT License.
