What you want
Step #1: Set up the undertaking
The first step in direction of organising LangChain Ask PDF is to obtain or clone the undertaking repository from GitHub.
You ought to see these undertaking information in your native disk.
Next, open the undertaking in Visual Studio Code and run the next command within the terminal:
pip set up -r necessities.txt
This command installs all the required undertaking dependencies which might be listed within the necessities.txt
file.
Note: In case you encounter a difficulty with Altair, add the
altair<5
on the finish of the necessities listing.
Step #2: Set up the setting variables
After efficiently organising the undertaking, the subsequent step is to configure the setting variables. Rename the file from .env.instance
to .env
.
Next, go to the OpenAI web site and create an account if you happen to don’t have one but. Once your account is ready up, navigate to the API keys tab and create a brand new secret key.
Copy your newly generated secret key and paste it into the OPENAI_API_KEY
variable in your .env
file.
Step #3: Run the appliance
With the setting variables arrange, now you can run the appliance. In your terminal, run the command:
streamlit run app.py
This command will robotically begin the Streamlit utility, which ought to open in your default internet browser.
Once the appliance is working, you possibly can start importing and “speaking” to your paperwork.
Step #4: Test the appliance
To confirm that every thing is working as anticipated, strive importing a PDF file by clicking on the “Browse information” button. After your file has been parsed by the appliance, a chat field ought to seem the place you possibly can sort in your questions.
The AI-powered app will then course of your questions and return solutions primarily based on the content material of your uploaded PDF file. It’s as if you happen to’re having a dialog together with your doc.
Amazing, isn’t it?