Preflexion is an AI-powered web application designed to provide personalized book and movie recommendations. Utilizing OpenAI's GPT-4 for intelligent suggestions, it caters to user-specific preferences, offering a unique and engaging experience.
The application utilizes OpenAI's GPT-4 model to interpret and respond to user queries with relevant book and movie recommendations. It's built using Flask, a lightweight web framework, ensuring a seamless and interactive user experience. Preflexion is not only a testament to the advancements in AI but also serves as an engaging tool for book and movie enthusiasts seeking personalized content.
This project requires Python and pip for installing dependencies. It is recommended to use a virtual environment to keep the dependencies required by different projects in separate places.
- Python 3.9 or later. You can download it from here.
- pip. It is already installed if you have Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org. If not, you can download it from here.
- Docker (optional for Docker setup)
- OpenAI API key
To get Preflexion up and running on your local machine, follow these steps:
-
Clone the Repository:
git clone https://github.com/Shayawnn/Preflexion.git
-
Change into the project directory:
cd Preflexion
-
(Recommended) Set Up the Environment:
- If you're using python3, it comes with the built-in
venv
module. - Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
- Windows:
venv\Scripts\activate
- Unix/MacOS:
source venv/bin/activate
- Windows:
- If you're using python3, it comes with the built-in
-
Install Dependencies:
pip install -r requirements.txt
-
Environment Variables:
- Create a
.env
file in the root directory. - Add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
- Create a
-
Run the Application:
python app.py
-
Access the Web Application:
- Open your browser and go to
http://localhost:5000/
If you prefer using Docker, a Dockerfile is provided. Build the Docker image and run it to start the application.
- Ensure Docker is installed
- Build the Docker image:
docker build -t preflexion:latest .
- Run the container:
docker run -p 5000:5000 preflexion:latest
- Access the application via a browser at
http://localhost:5000
.
- app.py: The main Flask application file.
- Dockerfile: For building a Docker image of the application.
- requirements.txt: List of Python dependencies.
- response/: Directory for storing user queries and AI responses for debugging purposes.
- static/: Contains CSS stylesheets and media files.
- templates/: HTML templates for the web interface.
- .env: Houses environment-specific variables, primarily the OpenAI API key.
This project is licensed under the terms of the GNU General Public License v3.0.