This repository contains a script for generating polite and professional reviews for Airbnb guests using OpenAI's GPT. It supports both command-line and web-based interfaces, with the web interface designed to be hosted via Docker.
See a live demo of the web interface here.
- CLI Interface: A simple script that prompts the user for details and generates a review.
- Web Interface: A user-friendly web application for generating reviews, which can be run locally or hosted using Docker.
git clone https://github.com/yourusername/airbnb-reviews.git
cd airbnb-reviews
cp .env-template .env
-
Create the virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip3 install -r requirements.txt
Set your OpenAI API key in an environment variable OPENAI_API_KEY
. You can create a .env
file in the root directory of the project with the following content:
OPENAI_API_KEY=your_openai_api_key
Run the script using Python:
python3 guest-reviews.py guest_name_here
-
Build the Docker image:
docker build -t airbnb-reviews-app .
-
Run the Docker container:
docker-compose up -d --build --remove-orphans
-
Access the Web Interface:
Open your browser and go to
http://localhost:5000
.
-
Ensure your virtual environment is activated.
-
Run the Flask application:
python3 app.py
-
Access the Web Interface:
Open your browser and go to
http://localhost:5000
.This port might be different if set in the .env file
.
├── Dockerfile
├── README.md
├── .env-template
├── app.py
├── config.py
├── docker-compose.yml
├── guest-reviews.py
├── requirements.txt
├── routes.py
└── templates
├── index.html
├── note.html
├── review.html
└── setup.html
- When prompted, enter the name of the person/service.
- Provide a rating (1 for bad, 2 for ok, 3 for good).
- Add any specific comments you want to include in the review.
- The generated review will be displayed and copied to the clipboard.
The required dependencies are listed in the requirements.txt
file:
openai
pyperclip
python-dotenv
Flask
This project is licensed under the MIT License. See the LICENSE
file for details.
By following the steps outlined above, you can use the Airbnb Review Generator both from the command line and via a web interface. The Docker setup makes it easy to run the web application in any environment.