markdown Copy code
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.
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
- Install Python (version 3.7 or higher).
- Get an OpenWeatherMap API Key:
- Sign up at OpenWeatherMap and generate an API key.
- 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
- .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.
-
Invalid City Name Symptom: 404 Not Found. Fix: Check spelling or include the country code (e.g., London,GB).
-
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!