Welcome to the Spotify with Langchain project! This Jupyter notebook-based application leverages the power of the Spotify Web API and Spotipy SDK to respond to natural language inputs. By integrating Langchain's advanced PALChain (Program-Aided Language) prompting technology, this project offers an intuitive way to interact with Spotify's vast music database. The project features a Gradio chat interface, providing a seamless user experience for querying and receiving information in natural language.
- Natural Language Processing: Interact with Spotify using everyday language.
- Spotipy SDK Integration: Access Spotify's comprehensive API for detailed data retrieval.
- PALChain Technology: Leverage advanced language model prompting for accurate responses.
- Gradio Chat Interface: Enjoy an interactive, user-friendly chat interface for queries.
- Environment-Friendly Setup: Easy setup with environment variable management.
- Python 3.6 or higher
- Jupyter Notebook
- Basic knowledge of Python and Jupyter environments
-
Clone the Repository
git clone [repository URL] cd [repository name]
-
Create Environment File
- In the repository's root folder, create a
.env
file and include the following keys:OPENAI_API_KEY=sk-redacted SPOTIFY_CLIENT_ID=redacted SPOTIFY_CLIENT_SECRET=redacted PINECONE_API_KEY=redacted PINECONE_ENVIRONMENT=gcp-starter
- Replace
redacted
with your actual API keys.
- In the repository's root folder, create a
-
Set Up Virtual Environment (Optional)
- It's recommended to create a virtual environment to avoid conflicts with existing Python packages.
python -m venv .venv source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
- It's recommended to create a virtual environment to avoid conflicts with existing Python packages.
-
Open and Configure Jupyter Notebook
- Launch Jupyter Notebook:
jupyter notebook
- Open
main.ipynb
. - Replace
reload_ext
withload
only for the first time you run this notebook.
- Launch Jupyter Notebook:
-
Run the Notebook
- Execute the cells in
main.ipynb
as needed. - Interact with the Gradio chat interface to send queries and receive responses.
- Execute the cells in
-
Query Examples
- Ask for song recommendations based on genre, mood, or artist.
- Retrieve song details or artist information.
- Explore playlists or albums.