This commit is contained in:
18
docs/snippets/kotlin/api/batch_extract_files_sync.md
Normal file
18
docs/snippets/kotlin/api/batch_extract_files_sync.md
Normal file
@@ -0,0 +1,18 @@
|
||||
```kotlin title="Kotlin"
|
||||
import dev.kreuzberg.*
|
||||
import java.nio.file.Paths
|
||||
|
||||
fun main() {
|
||||
val config = ExtractionConfig.builder().build()
|
||||
val items = listOf(
|
||||
BatchFileItem(Paths.get("doc1.pdf"), null),
|
||||
BatchFileItem(Paths.get("doc2.docx"), null),
|
||||
BatchFileItem(Paths.get("report.pdf"), null),
|
||||
)
|
||||
val results = Kreuzberg.batchExtractFilesSync(items, config)
|
||||
|
||||
results.forEachIndexed { index, result ->
|
||||
println("File $index: ${result.content().length} chars")
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user