Code Monkey home page Code Monkey logo

ai-to-latex's Introduction

Here is an illustration of what the WebUI looks like (while undergoing development)

Flask Blog and PDF Generator

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.

Features

  • 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.

Prerequisites

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.

Installation

To install the project dependencies, run the following command in your virtual environment:

pip install -r requirements.txt

Configuration

http://localhost:5000

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

To install all LaTeX tlmgr packages if a template doesnt compile

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

ai-to-latex's People

Contributors

panoskolyvakis avatar

Stargazers

Elias Kassapis avatar Cyclotomic Fields avatar Kolois avatar qwqcode avatar Piyush Kumar Singh avatar Jeffery Ye avatar  avatar Lan Qingyong avatar Wenwen Zhang avatar Panos Karabelas avatar  avatar acfm avatar Hao Zhang avatar

Watchers

Wenwen Zhang avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.