6 projects using OpenAI APIs with Python.
You need to create a virtual env and install the packages listed in requirements.txt
. You can then run Jupyter Notebooks in VS Code.
Follow these steps: How to Work with Python Virtual Environments, Jupyter Notebooks and VS Code.
You need to create a .env
file with your OPENAI_API_KEY
.
A visual tool to generate color palettes using OpenAI Completion API with Python.
Check the 01-color-palette-generator folder
- writing the color palette generator prompt.
- writing a color-swatch rendering function.
- setting up the Flask server.
- integrating OpenAI with server.
- writing the palette endpoint.
- creating the form.
- rendering the colors in the browser.
- styling the color blocks and the form.
- refactoring our front-end code.
A simple command line chatbot with ChatGPT-4.
Check the 02-gpt-4-chatbot folder
- writing the basic chatbot structure.
- persisting messages accross requests.
- adding optional personalities.
- colorizing the chatbot output.
A simple command-line-based code reviewer.
Check the 03-automatic-code-reviewer folder
- building a basic code reviewer.
- adding an interactive code reviewer.
A playlist generator for Spotify with OpenAI's GPT-4.
Check the 04-gpt-4-ai-spotify-playlist-generator folder
- writing the playlist generating prompt.
- adding Spotify developer credentials.
- using Spotify authentication via Python.
- searching for Spotify tracks via Python.
- creating Spotify playlists programmatically.
- adding in OpenAI.
- accepting command line arguments.
An embedding-powered movie recommendation algorithm using Nomic Atlas.
Check the 05-movie-recommendation-system folder
- getting our movie data.
- getting our movie data ready.
- generating embeddings for 50 movies.
- visualizing our embeddings with Atlas.
- recommending movies using our embeddings.
A dynamic Q&A Bot using GPT-4.
- scraping data from Wikipedia.
- generating a bunch of embeddings on the last Formula One season.
- turning the questions from users into embeddings.
- finding the K nearest neighbors to that embedding.
- including the matching texts in the prompt to expand GPT-4 knowledge.
Check the playground to understand the basics.
Based on Mastering OpenAI Python APIs: Unleash the Power of GPT4 by Colt Steele (2023).