This project is a Flask-based web application that utilizes Google Custom Search and OpenAI's GPT to generate blog posts based on user queries. It then formats these posts into LaTeX and compiles them into PDFs for download. This README outlines how to set up and run the project locally.
There is a video on this URL of my BLOG clearly illustrating all the incorporated features
The user can now do consecutive calls to the GPT API to improve the document according to preferences (e.g. you can click refine button to add/remove paragraphs, or customize the document in general).
The current plan is to cache and keep data of good LLM responses (prompt- answer pairs), such that a GPT LLM is fine tuned in the future once enough high quality training examples are generated for training. This is due to OpenAI making fine-tuned models accessible by the API recently ...
I have recently added a .tex editor that can be used to recompile the document to the webUI. The editor may be used to edit the document manually and recompile.
*Once the project is completed, I plan to deploy it on the web, possibly using Heroku or AWS.
- Google Custom Search to fetch relevant URLs based on user queries.
- OpenAI's GPT integration for generating rich, relevant content for blog posts.
- LaTeX for formatting and compiling blog posts into downloadable PDF documents.
- A simple, user-friendly web interface for submitting queries and downloading blog posts as PDFs.
Before you begin, ensure you have met the following requirements:
- Python 3.6 or later installed on your machine.
- Flask installed in your Python environment.
- Access to OpenAI's API and a valid API key.
- A Google Custom Search Engine set up with an API key and Search Engine ID.
- LaTeX installed on your system for PDF generation.
To install the project dependencies, run the following command in your virtual environment:
pip install -r requirements.txt
NOTE: to initialize the prohect you need to add a configuration.py file with the following script:
class Config:
def __init__(self):
self.response_path = 'static/docs/response.tex'
self.openapi_key = 'fromAPIkey'
self.google_API_KEY = 'fromGoogleCustomSearchEnginges'
self.google_CSE_ID = 'fromGoogleCustomSearchEnginges'
self.DEBUG_URL = 'https://en.wikipedia.org/wiki/Cattle'
self.html_template= 'templates'
self.tex_file = 'static/docs/response.tex'
alternatively you can add variables to your path
Ensure that the .sh script is executable
chmod +x install_latex_packages.sh
Run the script to install all .tex-required packages NOTE: you probably need to run sudo
sudo ./install_latex_packages.sh