Auto mode
When using auto_mode
, LlamaParse will first parse documents using the standard mode, and if some condition are met will reparse specific pages of document in premium_mode=true
.
To activate auto_mode
you need to set it to true
parser = LlamaParse(Using the API:
  auto_mode=True
)
curl -X 'POST' \
  'https://api.cloud.llamaindex.ai/api/parsing/upload'  \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  --form 'auto_mode="true"' \
  -F 'file=@/path/to/your/file.pdf;type=application/pdf'
Trigger on table​
If you want to upgrade parsing of page to premium_mode
when there is table in the page, set the boolean auto_mode_trigger_on_table_in_page
to true.
parser = LlamaParse(Using the API:
  auto_mode_trigger_on_table_in_page=True
)
curl -X 'POST' \
  'https://api.cloud.llamaindex.ai/api/parsing/upload'  \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  --form 'auto_mode_trigger_on_table_in_page="true"' \
  -F 'file=@/path/to/your/file.pdf;type=application/pdf'
Trigger on image​
If you want to upgrade parsing of page to premium_mode
when there is some images in the page, set the boolean auto_mode_trigger_on_image_in_page
to true.
parser = LlamaParse(Using the API:
  auto_mode_trigger_on_image_in_page=True
)
curl -X 'POST' \
  'https://api.cloud.llamaindex.ai/api/parsing/upload'  \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  --form 'auto_mode_trigger_on_image_in_page="true"' \
  -F 'file=@/path/to/your/file.pdf;type=application/pdf'
Trigger on regexp​
If you want to upgrade parsing of page to premium_mode
when a specific regexp is true on the content of the page, set the regexp in auto_mode_trigger_on_regexp_in_page
. The regexp are in the ECMA262 format.
parser = LlamaParse(Using the API:
  auto_mode_trigger_on_regexp_in_page="/((total cost)|(tax))/g"
)
curl -X 'POST' \
  'https://api.cloud.llamaindex.ai/api/parsing/upload'  \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  --form 'auto_mode_trigger_on_regexp_in_page="true"' \
  -F 'file=@/path/to/your/file.pdf;type=application/pdf'
Trigger on text​
If you want to upgrade parsing of page to premium_mode
when a specific text exist in the content of the page, set auto_mode_trigger_on_text_in_page
to the desired value.
parser = LlamaParse(Using the API:
  auto_mode_trigger_on_text_in_page="total"
)
curl -X 'POST' \
  'https://api.cloud.llamaindex.ai/api/parsing/upload'  \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
  --form 'auto_mode_trigger_on_text_in_page="total"' \
  -F 'file=@/path/to/your/file.pdf;type=application/pdf'