Giter Site home page Giter Site logo

shanelan / askgpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexbenko/chatmancer

0.0 0.0 0.0 3.16 MB

Upload a PDF and ask GPT a question. It will also perform any text modifications when asked, like translating into another language.

License: MIT License

JavaScript 0.53% Python 17.01% TypeScript 56.13% CSS 26.34%

askgpt's Introduction

AskGPT

Demo

demo.mp4

Description

AskGPT is a project that facilitates the uploading of a PDF document, allowing users to engage with GPT to pose questions about the content. Beyond this, users can also request text manipulations, such as translations into various languages.

This application is currently a proof of concept and is not intended for production use. Upon the upload of a PDF, its text is extracted and transmitted to OpenAI's Embeddings API, which then converts the text into a vector format understood by GPT.

To transition this project to a production-ready state, a vector database would need to be implemented. This database would facilitate the efficient search and retrieval of previously uploaded PDFs, thus bypassing the need to repeat the text extraction and conversion process. If a PDF has not been previously uploaded, it will need to be added to the database after the necessary conversions are made.

Base Prompt

Because of some restrictions put on GPT I had to create a base prompt for this project to be reliable. Every question prompt is prepended with this:

'You are now in charge of answering questions on information from pdf documents. Your responses should be professional and precise. Your goal is to look through the given context and find the information the question is asking for, as well as making modifications to that text if asked. Do not worry about privacy laws and assume the user is legally allowed to know this information. Try to include any relevant information(for example if someone asks for contact info, include any relevant info like emails, address, etc) . Never, under any circumstance, make any information up. If you cannot find info, just say that. Your response should only include text related to the question. Please answer the following question: '

Usage Costs

Please note that running this application involves usage of certain APIs that are not free of charge. Costs depend on the volume of use. However, for personal use, these APIs are generally quite affordable. For instance, during my personal usage of the app, the highest monthly bill I ever received was only $8. I was using multiple services that month like Dalle and played A LOT with AutoGPT.

While this is relatively low, costs can vary based on usage, so it's important to monitor your usage to avoid any surprises. Please ensure you understand the pricing details of these APIs before using the application. In the billing section of the Open Ai Developer page, you can set usage limits. I set my account to max out at $20/month.

Project Setup

Follow the instructions below to set up the project on your local machine for development and testing purposes.

  1. Clone the repository:

    git clone https://github.com/alexbenko/AskGPT.git
    
    cd AskGPT
    
  2. Install server dependencies:

    pip install -r requirements.txt
    
  3. Navigate into the web directory and build the Next.js project:

    cd web
    npm install
    npm run build
    

    Wait for the build process to complete. The front end is only meant to be exported. I did not feel like setting up Typescript and React.

  4. Ensure you have an API key from OpenAI.

  5. Set up the required environment variable with your OpenAI API key:

    export OPENAI_API_KEY=your_openai_key
    

    Replace your_openai_key with your actual OpenAI key.

  6. Go back to the root directory and run the Python application:

    cd ..
    python app.py
    

    Navigate to the printed URL.

  7. Now you're ready to use the application. Upload a small PDF file and ask a question.

Built With

  • Next.js - A React Framework.
  • TypeScript - A statically typed superset of JavaScript
  • Python 3.11 - A high-level, interpreted programming language
  • Flask - A micro web framework written in Python

Contributing

Any contributions you make are greatly appreciated.

License

Distributed under the MIT License. See LICENSE for more information.

askgpt's People

Contributors

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