Skip to content

0aprl1/chat-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This repository contains commands to index PDF files into a vector DB and subsequently retrieve data from it to be exposed to a chat model.

Data is stored locally, and only what is retrieved from it is shared online with the chat model.

Prerequisites

In order to make the scripts work, you need to replace the current value of the OPENAI_API_KEY variable in the .env file with your OpenAI API key.

Code was tested using Python 3.9.6 version.

Demo

Run the following command to run a demo:

make demo

Note that the above command will index a sample PDF document every time the command is run, which consumes credits from your OpenAI account when calling the embeddings API.

If successful, you can run commands individually to make better use of your environment.

To set up the environment, run:

make set-up-env ENV=your-optional-custom-name

To index a document, run:

make index-pdf-document ENV=your-optional-custom-name DB_NAME=optional-custom-name PDF_NAME=optional-file-name

Note that the above command consumes credits from your OpenAI account when calling the embeddings API.

To chat, run:

make start-chat ENV=your-optional-custom-name DB_NAME=optional-custom-name

About

A PDF reader that you can chat with

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published