This script extracts structured data from PDF files.
Before you run the script, make sure you have:
Node.jsinstalled on your machine- An API key for
gpt-4.
-
First, define all the possible document types in the
types/documentType.tsfile. -
Then, specify all the document schemas in the
constants/schema.tsfile. -
To configure the script to work with your
gpt-4API key and any other settings, you'll need to set up environment variables:
Rename the provided .example.env file to .env in the root directory of the project:
mv .example.env .env