This demo showcases a Spotify Assistant that helps users create Spotify playlists through pipecat. The assistant uses services like Spotify API, Google LLM, Deepgram STT, and Cartesia TTS to provide a seamless experience.
- Authenticate with Spotify
- Create playlists based on mood, genre, artist or whatever comes to mind
- Start playback of generated playlists
- Python 3.8+
- Spotify Developer Account
- Spotify account (Premium subscription required for controlling playback)
- Google API Key
- Deepgram API Key
- Cartesia API Key
To use the Spotify Assistant, you need to create a Spotify app to obtain a client ID and client secret. Follow these steps:
- Go to the Spotify Developer Dashboard.
- Log in with your Spotify account.
- Click on "Create an App".
- Fill in the required details such as the app name and description.
- Click on "Create".
- Once the app is created, you will find the client ID and client secret on the app's dashboard.
Make sure to add these credentials to your .env
file as shown in the setup section.
-
Clone the repository:
git clone https://github.com/yourusername/spotify-assistant-demo.git cd spotify-assistant-demo
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Copy the example environment file and rename it to
.env
:cp env.example .env
-
Open the
.env
file and enter your API keys and other environment variables:SPOTIFY_CLIENT_ID=your_spotify_client_id SPOTIFY_CLIENT_SECRET=your_spotify_client_secret GOOGLE_API_KEY=your_google_api_key DEEPGRAM_API_KEY=your_deepgram_api_key CARTESIA_API_KEY=your_cartesia_api_key DAILY_API_KEY=your_daily_api_key DAILY_SAMPLE_ROOM=your_daily_room_url
-
Run the main script:
python spotify-assistant.py
-
Follow the instructions in the terminal to authenticate with Spotify.
-
Interact with the assistant to create and manage your playlists.
This project is licensed under the BSD 2-Clause License.