This commit is contained in:
16
docs/snippets/r/utils/token_reduction_example.md
Normal file
16
docs/snippets/r/utils/token_reduction_example.md
Normal file
@@ -0,0 +1,16 @@
|
||||
```r title="R"
|
||||
library(kreuzberg)
|
||||
|
||||
config <- list(
|
||||
token_reduction = list(
|
||||
mode = "moderate",
|
||||
preserve_important_words = TRUE
|
||||
)
|
||||
)
|
||||
|
||||
json <- extract_file_sync("verbose_document.pdf", "application/pdf", config)
|
||||
result <- jsonlite::fromJSON(json, simplifyVector = FALSE)
|
||||
|
||||
cat(sprintf("Reduced content length: %d characters\n", nchar(result$content)))
|
||||
cat(sprintf("MIME type: %s\n", result$mime_type))
|
||||
```
|
||||
Reference in New Issue
Block a user