This app allows users to convert their W2 PDF docs to JSON using ChatGPT. It provides a backwards compatible API complete with backend and front end validations. Making use of the following technologies:
- Instructor is used to patch the open ai client ensuring reliability and consistency of the LLM's data structures. https://python.useinstructor.com/
- Pydantic is used to define the data models. Including optional fields and any other field validation requirements
- Zod is used to validate the json schema on the front end and gracefully handle errors if the api returns an unknown json schema
-
Clone the repository:
git clone https://github.com/duncandevs/llm-tax-demo.git cd llm-tax-demo
-
Install the backend dependencies: from root cd into back-end
cd back-end
pip install -e .
-
Set the OpenAI key:
replace OPEN_AI_KEY in back-end .env file with your openai key
-
Install the front end dependencies from root cd into front-end
cd front-end
run install command with yarn
yarn install
To start the back-end, run the following command:
start-app
To start the front-end, run the following command:
yarn dev
Once backend and frontend are running View the app on:
localhost:3000
See the example PDF in the examples folder to test the app