After entering your favourite titles, the AI will fetch the given book's data such as title, genre, and summary. All this info is given to ChatGPT using a prompt template which will then return book reccomendations!
The AI Reading Finder 🤖📚 works by utilising two main technologies: Goodreads 📖 for fetching book data, and OpenAI's ChatGPT 🧠 for generating AI recommendations.
-
Goodreads 📖: I use Goodreads to get the details about the supplied favorite books 📚, including the book title 🏷️, author 🖋️, genres 🏷️, and synopsis 📝. This script will then extract this data and use it to generate AI personalized book recommendations 🎯.
-
OpenAI's ChatGPT 🧠: I use ChatGPT to generate AI book recommendations based on the book data fetched from Goodreads 📖. We supply ChatGPT with a conversation context 🗨️ where the user talks about their favorite books (the data fetched from Goodreads). The AI then responds with book recommendations 📚 in a conversational manner.
- Python 3.7 and above 🐍
- An OpenAI API key 🔑
- Git 📚
Here is detailed explanation for installing all the dependencies 🧩.
- Clone this repository on your local machine.
git clone https://github.com/decisivedevops/ai-book-recommender.git
- Navigate to the repository.
cd ai-book-recommender/
- Create a Python virtual environment and activate it.
python3 -m venv venv
source venv/bin/activate
- Install the necessary dependencies.
pip install -r requirements.txt
- Rename the
sample.config.toml
file toconfig.toml
:
mv sample.config.toml config.toml
-
Open the
config.toml
file and update your OpenAI API key in the appropriate field. -
Update your favorite books info in the
config.toml
file. Follow the provided format and add the titles and authors of your favorite books.
[books]
favorites = """
Book Title, Author
Book Title, Author
Book Title, Author
"""
- Run the
main.py
script:
python3 main.py
- The script gives reading recommendations based on your favorite books. The suggestions are also saved in the
logs
folder.
The configuration file, config.toml
, has various settings used by the script:
- OpenAI settings, including the model name, temperature, and API key 🌡️.
- A list of your favorite books 📚.
- Message templates used when interacting with ChatGPT 💌.
AI Reading Finder is open source and available under the MIT License.