Skip to content

Your Personal Librarian, Powered by ChatGPT! πŸ€–πŸ“˜

License

Notifications You must be signed in to change notification settings

decisivedevops/ai-book-recommender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“šπŸ’‘ AI Book Recommender

tl;dr πŸ“

You give your favorite books, the script fetches books information such as title, genres, and synopsis. All this info is passed to ChatGPT using a prompt template to get the book recommendations.

Table of Contents πŸ—‚οΈ

Demo πŸŽ₯

Demo

Description πŸ“š

The AI Book Recommender πŸ€–πŸ“š works by interacting with two main components: Goodreads πŸ“– for fetching book data, and OpenAI's ChatGPT 🧠 for generating recommendations.

  • Goodreads πŸ“–: We're using Goodreads to fetch details about your favorite books πŸ“š, including the book title 🏷️, author πŸ–‹οΈ, genres 🏷️, and synopsis πŸ“. The script then extracts this data and uses it to generate personalized book recommendations 🎯.

  • OpenAI's ChatGPT 🧠: We're using ChatGPT to generate book recommendations based on the book data fetched from Goodreads πŸ“–. We feed 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.

Usage πŸ› οΈ

Requirements βš™οΈ

  • Python 3.7 and above 🐍
  • An OpenAI API key πŸ”‘
  • Git πŸ“š

Here is detailed explanation for installing all the dependencies 🧩.

Getting Started πŸš€

  1. Clone this repository on your local machine.
git clone https://github.com/decisivedevops/ai-book-recommender.git
  1. Navigate to the repository.
cd ai-book-recommender/
  1. Create a Python virtual environment and activate it.
python3 -m venv venv
source venv/bin/activate
  1. Install the necessary dependencies.
 pip install -r requirements.txt
  1. Rename the sample.config.toml file to config.toml:
mv sample.config.toml config.toml
  1. Open the config.toml file and update your OpenAI API key in the appropriate field.

  2. 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
"""
  1. Run the main.py script:
python3 main.py
  1. The script gives reading recommendations based on your favorite books. The suggestions are also saved in the logs folder.

Configuration βš™οΈ

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 πŸ’Œ.

Contributing πŸ‘‹

Contributions are welcome. If you find a bug 🐞 or have an idea for an improvement or new feature, please raise an issue or submit a pull request.

License πŸ“œ

AI Book Recommender is open source and available under the MIT License.

About

Your Personal Librarian, Powered by ChatGPT! πŸ€–πŸ“˜

Topics

Resources

License

Stars

Watchers

Forks

Languages