How to prepare your PDF docs to Smabbler API RAG using LlamaParse?

Described PDF docs processing will be presented using the LlamaParse libarrow-up-right.

Following example will be done using Python, due to LlamaParse native support for this language.


Getting started

  1. Collect documents: gather all PDF documents you wish to process and place them in a single directory.

  2. Create an account: sign up for a free account on LlamaIndex and obtain an API Key herearrow-up-right.

  3. Install LlamaParse: run the following commands to ensure you have the latest version of LlamaParse installed.

pip uninstall llama-index

pip install -U llama-index --upgrade --no-cache-dir --force-reinstall

pip install llama-parse

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.

circle-info

Document text will be parsed up to 2 000 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.

Last updated