ChatGPTify icon indicating copy to clipboard operation
ChatGPTify copied to clipboard

add webapp, spotify oauth, some ui, some refactor

Open Deniz97 opened this issue 2 years ago • 1 comments

Sorry for big pr, i aimed to make it into a webapp for easier usage, also we can display usefull info on the ui for easier analysis.

  • Add flask web app, add frontend with flask templates
  • add spotify oauth and use access token
  • Extract chatgpt library out from the playlist manager
  • Add code for sqlite file db but not using it yet
  • add .env and load_dotenv image

TODO: Add chatgpt questions and answers to frontend also Add created playlists to db to persist and later analyze them? Add a rating mechanism to rate chatgpt's playlists so that we can rank them and experiment?

Idea:

  • "Choose the next song", take the last listened N songs, and recomended a song to keep going the mood.
  • Implement openai api by hand so we can ditch the chatgpt_wrapper and installation step

Deniz97 avatar Apr 04 '23 09:04 Deniz97

Hi @Deniz97!

Thanks for the nice PR!

Flask web app

I also had a similar idea like this one! Since I already have one Flask app for playlist recommendation, I actually thought adding it under this web page. It shows your Spotify listening analysis and creates playlists based on your listening history & some audio features that can be provided by the user e.g. danceability, tempo, energy.

The layout for playlist generation I used there is similar to your suggestion, feel free to check this repo. Perhaps, the front-end can be used as given there. This is a bit messy 2-day hackathon code, so I hope it is okay :)

On Database

Well, this is where things get a little debatable. While creating both of these apps I tried to not store any user-related data due to several reasons. First, for collecting Spotify data, you need to communicate this clearly that the user data will safely be stored from your side. Second, while providing this data to ChatGPT, you need to be aware of the terms and conditions from OpenAI's side. Will this be data stored by a third-party (in this case OpenAI)? Will this data be used for further training of ML models? Users have the right to know.

Further Ideas

  • Choosing the next song can be a good idea, but maybe this is better if we use audio features of the songs as discussed above rather than just prompts?
  • Implementing the API is an option but the wrapper already provides a sample code for developing Flask web apps. It is currently experimental, but feel free to have a look here.

Have a great day!

idilsulo avatar Apr 09 '23 17:04 idilsulo