How to prepare your PDF docs to Smabbler API RAG using LlamaParse?
Described PDF docs processing will be presented using the LlamaParse lib.
Following example will be done using Python, due to LlamaParse native support for this language.
Getting started
Collect documents: gather all PDF documents you wish to process and place them in a single directory.
Create an account: sign up for a free account on LlamaIndex and obtain an API Key here.
Install LlamaParse: run the following commands to ensure you have the latest version of LlamaParse installed.
Data processing
Before running the following code, ensure you have correctly set the necessary variables:
api_key: your LlamaIndex API Key, as obtained in the "Getting Started" section.
To process the documents, run the following code in the directory containing your PDFs. All PDF documents in the directory will be processed, and the output will be saved to a CSV file.
Document text will be parsed up to 20,000 characters due to Smabbler's maximum text length limit.
As a result, file-export.csv file will be produced. This file can be used in next steps of RAG model building.