OCR Options
OCR options allow you to configure optical character recognition settings for processing images within documents. These options are available for all tiers.
Configuration
Section titled âConfigurationâUse processing_options.ocr_parameters to configure these options.
Available Options
Section titled âAvailable OptionsâLanguages
Section titled âLanguagesâSpecify which languages to use for OCR processing of images. This only affects text extracted from images, not native text in the document.
{ "tier": "agentic", "version": "latest", "processing_options": { "ocr_parameters": { "languages": ["en", "zh", "ja"] } }}Examples
Section titled âExamplesâSingle Language
Section titled âSingle Languageâ{ "tier": "fast", "version": "latest", "processing_options": { "ocr_parameters": { "languages": ["en"] } }}Multiple Languages
Section titled âMultiple Languagesâ{ "tier": "agentic_plus", "version": "latest", "processing_options": { "ocr_parameters": { "languages": ["en", "fr", "de", "es"] } }}Complete API Request Example
Section titled âComplete API Request Exampleâcurl -X 'POST' \ 'https://api.cloud.llamaindex.ai/api/v2/parse' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \ --data '{ "file_id": "<file_id>", "tier": "agentic", "version": "latest", "processing_options": { "ocr_parameters": { "languages": ["en", "es"] } } }'from llama_cloud import LlamaCloud
client = LlamaCloud(api_key="LLAMA_CLOUD_API_KEY")
result = client.parsing.parse( upload_file="example_file.pdf", tier="agentic", version="latest", processing_options={ "ocr_parameters": { "languages": ["en", "es"] } })import fs from "fs";import { LlamaCloud } from "@llamaindex/llama-cloud";
const client = new LlamaCloud({ apiKey: "LLAMA_CLOUD_API_KEY",});
const result = await client.parsing.parse({ upload_file: fs.createReadStream('example_file.pdf'), tier: "agentic", version: "latest", processing_options: { ocr_parameters: { languages: ["en", "es"] } }});