From c5a674aee73124c0c40a26016cd214f6189c01bc Mon Sep 17 00:00:00 2001 From: pavan3008 Date: Wed, 21 Feb 2024 13:45:15 -0800 Subject: [PATCH] Added portkey analytics and updated README.md --- README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++- backend/models.py | 8 ++++++- requirements.txt | 1 + 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a39d789..da1f663 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,60 @@ # 1040-GPT -Let GPT-4 fill your 1040s + +## Let GPT-4 Fill Your 1040s + +Welcome to our innovative application designed to simplify the tax filing process using the power of GPT-4. With `1040-GPT`, we aim to revolutionize how individuals and businesses complete their tax forms, making it faster, more accurate, and less stressful. + +Our application leverages the advanced natural language processing capabilities of GPT-4 to understand and process W2 and 1040 tax forms. Whether you're struggling with tax preparation or just looking for a way to streamline the process, our tool is here to assist. By automating the form-filling process, we minimize errors and maximize efficiency, allowing you to focus on what matters most. + +Follow the setup and usage instructions below to get started and experience a hassle-free tax season. + +## Getting Started + +Follow these steps to set up your environment and run the application. + +### Step 1: Install Dependencies + +Before running the application, you need to install the required Python packages. Open a terminal and navigate to the root directory of this project. Then run the following command: + +``` bash +pip install -r requirements.txt +``` + +This command reads the `requirements.txt` file and installs the Python packages listed there. + +### Step 2: Set Up Environment Variables + +You need to configure the required environment variables for the application. Create a `.env` file in the root directory and add your `OPEN_AI_API_KEY` and `PORTKEY_API_KEY` as follows: + +``` bash +OPEN_AI_API_KEY= +PORTKEY_API_KEY= +``` + +Replace `` and `` with your actual API keys. + +### Step 3: Run the Application + +To start the application, navigate to the `frontend/` directory and run the following command: + +`streamlit run app.py` + +This command launches the Streamlit application in your default web browser. + +## Using the Application + +Once the application is running, follow these steps to process and preview your tax forms: + +1. **Upload Forms:** In the web interface that opens, upload your W2 and 1040 forms by clicking on the respective upload buttons. + +2. **Process Forms:** After uploading the forms, click on the "Process Forms" button to start the processing. The application will analyze the uploaded documents. + +3. **Preview Tax Forms:** Upon successful processing, click on the "Prepare Tax Forms" button to get a preview of the filled form. You can review the information extracted and filled into the form. + +## Notes + +- Ensure your `.env` file is never shared or committed to a public repository. Include it in your `.gitignore` file to prevent accidental exposure of your API keys. + +- If you encounter any issues or need further assistance, please refer to the application documentation or contact support. + +Thank you for using our application! diff --git a/backend/models.py b/backend/models.py index 86a30ca..bbf5cf0 100644 --- a/backend/models.py +++ b/backend/models.py @@ -3,7 +3,13 @@ from openai import OpenAI from dotenv import load_dotenv load_dotenv() -client = OpenAI() +client = OpenAI( + base_url="https://api.portkey.ai/v1", + default_headers= { + "x-portkey-provider": "openai", + "Content-Type": "application/json" + } +) from glob import glob class Model: diff --git a/requirements.txt b/requirements.txt index f0f6cc5..2fb8588 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,6 +28,7 @@ packaging==23.2 pandas==2.2.0 pdf2image==1.17.0 pillow==10.2.0 +portkey_ai==1.1.7 protobuf==4.25.3 pyarrow==15.0.0 pydantic==2.6.1