πΆπ©βπ» A fun little web app that analyzes your Spotify playlists with help from OpenAI's language models.
GPL-3.0 License
PlaylistGPT is a fun little web application that allows you to ask questions about your Spotify playlists and receive answers from code generated by OpenAI's models (GPT-3.5 by default).
The entirety of this project was pair-programmed with ChatGPT-4 and Github Copilot using VS Code. Practically every line, including most of this README, was written by AI. It is a very iterative process and still needed a lot of user input, but I'm super impressed with their capabilities!
Please note that this project is a work in progress and its features are currently limited. As you might expect, AI-generated code isn't always perfect right away, so you may encounter some bugs. But I'll be (slowly) working on small improvements when I have the time!
** WARNING: This app uses Python's
exec()
command to execute code generated by GPT, so be sure to review the generated code in the UI before running it.**
Before you can run this app, you'll need to have the following software installed:
You will also need API keys for OpenAI and Spotify. To get these keys, follow these steps:
To set up and run the project, follow these steps:
git clone https://github.com/savbell/playlist-gpt.git
cd playlist-gpt
python -m venv venv
source venv/bin/activate # For Linux and macOS
venv\Scripts\activate # For Windows
pip install -r requirements.txt
cp .env.example .env # For Linux and macOS
copy .env.example .env # For Windows
OPENAI_API_KEY=<your_openai_key_here>
OPENAI_MODEL=gpt-3.5-turbo
SPOTIPY_CLIENT_ID=<your_spotify_client_id_here>
SPOTIPY_CLIENT_SECRET=<your_spotify_client_secret_here>
SPOTIPY_REDIRECT_URI=<your_spotify_redirect_uri_here>
flask run
Or, alternatively:
python run.py
If you encounter issues while setting up or running the app, consider checking the following:
If you're still experiencing issues, feel free to open an issue on the GitHub repository with a detailed description of the problem.
PlaylistGPT has a lot of potential for growth and additional features. Here are a few ideas for how the app could be expanded in the future:
Error Handling and Code Rewriting: To improve the app's overall functionality, I plan to implement an error handling and code rewriting feature. When the generated code runs into an error, an additional prompt will be sent to the OpenAI model requesting it to rewrite the code to fix the issue and then try running the code again.
Connecting to the Genius API: Another potential expansion for PlaylistGPT is to connect it to the Genius API. This would allow users to ask questions about the lyrics of specific songs and receive answers generated by the app.
Integration with Analysis Libraries: Integrating PlaylistGPT with analysis libraries such as pandas, matplotlib, etc. could allow for more in-depth answers to questions and potentially graphical responses.
Using More of the Spotify API Features: PlaylistGPT currently uses only a small subset of the Spotify API features. By using more of these features, such as the user's listening history and top artists and tracks, the app could be improved to provide more personalized responses to users.
Playlist Creation Based on User Prompts: Another potential expansion for PlaylistGPT could be playlist creation based on user prompts. Users could ask the app to generate a playlist based on specific criteria (e.g., mood, genre, etc.), and the app could generate a custom playlist for them. Note: This is a large expansion that's on my mind but likely won't be worked on for a while.
This is just a small personal project, but if you'd like to contribute, feel free to create a pull request with your proposed changes or open an issue to discuss your ideas.
This project is licensed under the GNU General Public License. See the LICENSE file for details.