Skip to content

jrichardson-sol/AI-Agent-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown Copy code

AI Agent Project

Overview

This is a command-line AI Agent project with the following features:

  • Weather Information: Fetches the current weather for any city using the OpenWeatherMap API.
  • To-Do List Management: Allows you to add, view, and remove tasks from a to-do list.

Project Structure

AI_AGENT_PROJECT/ ├── pycache/ # Auto-generated cache files (can be ignored) ├── .env # Stores the OpenWeatherMap API key ├── main.py # Entry point of the program ├── todo.py # To-do list functionality ├── weather.py # Weather-related functionality └── README.md # Project documentation

markdown Copy code

Setup Instructions

Prerequisites

  1. Install Python (version 3.7 or higher).
  2. Get an OpenWeatherMap API Key:

Steps

  1. Clone the repository:
    git clone https://github.com/jrichardson-sol/AI-Agent-Project.git
    cd AI-Agent-Project

Create a virtual environment:

bash Copy code python -m venv ai_agent_env ai_agent_env\Scripts\activate # On Windows source ai_agent_env/bin/activate # On macOS/Linux Install dependencies:

bash Copy code pip install requests python-dotenv Create a .env file and add your OpenWeatherMap API key:

makefile Copy code OPENWEATHER_API_KEY=your_actual_api_key_here Run the program:

bash Copy code python main.py Features Weather Functionality Fetch weather data for any city. Returns weather description and temperature. Handles invalid cities or API errors gracefully. To-Do List Management Add Tasks: Add tasks to your to-do list. View Tasks: View all tasks in your to-do list. Remove Tasks: Remove tasks by name. Common Issues and Debugging

  1. .env File Not Loading Symptom: API key is None or not found. Fix: Ensure:

.env is in the root directory. It contains the line: makefile Copy code OPENWEATHER_API_KEY=your_actual_api_key 2. Invalid API Key Symptom: 401 Unauthorized. Fix: Verify your API key on OpenWeatherMap. Regenerate if necessary.

  1. Invalid City Name Symptom: 404 Not Found. Fix: Check spelling or include the country code (e.g., London,GB).

  2. Missing Dependencies Symptom: ModuleNotFoundError. Fix: Ensure dependencies are installed:

bash Copy code pip install requests python-dotenv Extending the Project Add integration with other APIs (e.g., News, Currency Conversion). Persist the to-do list to a file or database. Build a GUI using tkinter or a web app with Flask. Contact If you encounter issues or have suggestions, feel free to open an issue or contribute to the project.

Markdown Elements Used Code blocks: For commands and file structure. Headings: To divide sections clearly. Bullet points: For lists and instructions. Links: To external resources (like OpenWeatherMap).

Push the changes to GitHub: bash Copy code git push origin main Once pushed, check your repository on GitHub, and you should see the well-formatted README.md displayed!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages