Skip to content

celalakcelikk/weather-gpt-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌤️ Weather GPT Assistant

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.

🚀 Features

  • ✨ 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)

🎥 Demo

🧠 Tech Stack

  • LLM: OpenAI GPT (gpt-4 or gpt-4o)
  • Weather API: Weather API (current & forecast)
  • Frontend: Streamlit
  • Backend: Python, OpenAI Function Calling
  • Logging: Python logging module
  • 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
    

⚙️ Installation

# 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.sh

🔑 Environment Variables

From .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.

🧪 Quality & Tests

# 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.

📸 UI

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

📄 License

This project is licensed under the MIT License.

About

Smart weather assistant using GPT Function Calling and OpenWeather API to suggest outfits and activities.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published