Giter Site home page Giter Site logo

bmtools_spotify's Introduction

BMTools with Spotify tool

This repository is forked from BMTools

How to use

Environment setup

first clone or download this repository

cd BMTools
pip install --upgrade pip
pip install -r requirements.txt
python setup.py develop

then create a virtual environment and switch to it

python -m venv myenv
source myenv/bin/activate

Get API keys

To run this tools for Spotify, you need to have an OpenAI account and a spotify account.

Generate OPENAI_API_KEY in here, the performance of this tool sometimes highly depends on the rate limits of calling openAI, so the cheapest way is register a new open account to get the $5 free credits.

Get SPOTIPY_CLIENT_SECRET, SPOTIPY_CLIENT_ID and SPOTIPY_REDIRECT_URI, please follow this document to create a spotify app, set the SPOTIPY_REDIRECT_URI to http://localhost:8888/callback/

Run it

To run the tool, two process should be operated at the same time (i.e in two terminal tabs)

In the terminal for the server, export the environment variable and run host_local_tools.py:

export OPENAI_API_KEY= 'Your key'
export SPOTIPY_CLIENT_ID='Your client ID'
export SPOTIPY_CLIENT_SECRET='Your secret'
export SPOTIPY_REDIRECT_URI='http://localhost:8888/callback/'
./myenv/bin/python host_local_tools.py

In the terminal for the server, export the environment variable and run web_demo.py:

export OPENAI_API_KEY= 'Your key'
export SPOTIPY_CLIENT_ID='Your client ID'
export SPOTIPY_CLIENT_SECRET='Your secret'
export SPOTIPY_REDIRECT_URI='http://localhost:8888/callback/'
./myenv/bin/python web_demo.py

When web_demo.py is running, it should automatically open 127.0.0.1 in your defult browser . Check the spotify in Tolls provided and input questions in the textfield.Webdemo

Other tools

For other tools used in BMTools:

  1. follow their readme to find where to get the API keys for corresponding tools

  2. uncomment corresponding lines in both host_local_tools.py and web_demo.py

  3. follow the same process of exporting api environment variables

bmtools_spotify's People

Contributors

callmel avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.