This commit is contained in:
19
docs/snippets/ruby/config/config_programmatic.md
Normal file
19
docs/snippets/ruby/config/config_programmatic.md
Normal file
@@ -0,0 +1,19 @@
|
||||
```ruby title="Ruby"
|
||||
require "kreuzberg"
|
||||
|
||||
config = Kreuzberg::ExtractionConfig.new(
|
||||
use_cache: true,
|
||||
ocr: Kreuzberg::OcrConfig.new(
|
||||
backend: "tesseract",
|
||||
language: "eng+deu",
|
||||
tesseract: Kreuzberg::TesseractConfig.new(psm: 6)
|
||||
),
|
||||
chunking: Kreuzberg::ChunkingConfig.new(
|
||||
max_characters: 1000,
|
||||
overlap: 200
|
||||
)
|
||||
)
|
||||
|
||||
result = Kreuzberg.extract_file_sync("document.pdf", config)
|
||||
puts "Content length: #{result.content.length}"
|
||||
```
|
||||
Reference in New Issue
Block a user