if (FALSE) {
# Process a large PDF with default settings
result <- process_large_pdf(
pdf_path = "large_document.pdf",
api_key = Sys.getenv("GEMINI_API_KEY")
)
# Process with smaller chunks and specific model
result <- process_large_pdf(
pdf_path = "very_large_document.pdf",
api_key = Sys.getenv("GEMINI_API_KEY"),
pages_per_chunk = 3,
model = "2.5-flash"
)
# Combine all chunks into single text
if (!is.null(result)) {
full_text <- paste(unlist(result), collapse = "\n\n")
}
}
Run the code above in your browser using DataLab