---
title: "Kotlin API Reference"
---
## Kotlin API Reference v5.0.0-rc.3
### Functions
#### extractBytes()
Extract content from a byte array.
This is the main entry point for in-memory extraction. It performs the following steps:
1. Validate MIME type
2. Handle legacy format conversion if needed
3. Select appropriate extractor from registry
4. Extract content
5. Run post-processing pipeline
**Returns:**
An `ExtractionResult` containing the extracted content and metadata.
**Errors:**
Returns `KreuzbergError.Validation` if MIME type is invalid.
Returns `KreuzbergError.UnsupportedFormat` if MIME type is not supported.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| ---------- | ------------------ | -------- | ------------------------- |
| `content` | `ByteArray` | Yes | The byte array to extract |
| `mimeType` | `String` | Yes | MIME type of the content |
| `config` | `ExtractionConfig` | Yes | Extraction configuration |
**Returns:** `ExtractionResult`
**Errors:** Throws `Error`.
---
#### extractFile()
Extract content from a file.
This is the main entry point for file-based extraction. It performs the following steps:
1. Check cache for existing result (if caching enabled)
2. Detect or validate MIME type
3. Select appropriate extractor from registry
4. Extract content
5. Run post-processing pipeline
6. Store result in cache (if caching enabled)
**Returns:**
An `ExtractionResult` containing the extracted content and metadata.
**Errors:**
Returns `KreuzbergError.Io` if the file doesn't exist (NotFound) or for other file I/O errors.
Returns `KreuzbergError.UnsupportedFormat` if MIME type is not supported.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| ---------- | ------------------ | -------- | ----------------------------------------------------------- |
| `path` | `Path` | Yes | Path to the file to extract |
| `mimeType` | `String?` | No | Optional MIME type override. If None, will be auto-detected |
| `config` | `ExtractionConfig` | Yes | Extraction configuration |
**Returns:** `ExtractionResult`
**Errors:** Throws `Error`.
---
#### extractFileSync()
Synchronous wrapper for `extract_file`.
This is a convenience function that blocks the current thread until extraction completes.
For async code, use `extract_file` directly.
Uses the global Tokio runtime for 100x+ performance improvement over creating
a new runtime per call. Always uses the global runtime to avoid nested runtime issues.
This function is only available with the `tokio-runtime` feature. For WASM targets,
use a truly synchronous extraction approach instead.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| ---------- | ------------------ | -------- | ------------------------- |
| `path` | `Path` | Yes | Path to the file |
| `mimeType` | `String?` | No | The mime type |
| `config` | `ExtractionConfig` | Yes | The configuration options |
**Returns:** `ExtractionResult`
**Errors:** Throws `Error`.
---
#### extractBytesSync()
Synchronous wrapper for `extract_bytes`.
Uses the global Tokio runtime for 100x+ performance improvement over creating
a new runtime per call.
With the `tokio-runtime` feature, this blocks the current thread using the global
Tokio runtime. Without it (WASM), this calls a truly synchronous implementation.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| ---------- | ------------------ | -------- | ------------------------- |
| `content` | `ByteArray` | Yes | The content to process |
| `mimeType` | `String` | Yes | The mime type |
| `config` | `ExtractionConfig` | Yes | The configuration options |
**Returns:** `ExtractionResult`
**Errors:** Throws `Error`.
---
#### batchExtractFilesSync()
Synchronous wrapper for `batch_extract_files`.
Uses the global Tokio runtime for optimal performance.
Only available with `tokio-runtime` (WASM has no filesystem).
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| -------- | --------------------- | -------- | ------------------------- |
| `items` | `List` | Yes | The items |
| `config` | `ExtractionConfig` | Yes | The configuration options |
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### batchExtractBytesSync()
Synchronous wrapper for `batch_extract_bytes`.
Uses the global Tokio runtime for optimal performance.
With the `tokio-runtime` feature, this blocks the current thread using the global
Tokio runtime. Without it (WASM), this calls a truly synchronous implementation
that iterates through items and calls `extract_bytes_sync()`.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| -------- | ---------------------- | -------- | ------------------------- |
| `items` | `List` | Yes | The items |
| `config` | `ExtractionConfig` | Yes | The configuration options |
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### batchExtractFiles()
Extract content from multiple files concurrently.
This function processes multiple files in parallel, automatically managing
concurrency to prevent resource exhaustion. The concurrency limit can be
configured via `ExtractionConfig.max_concurrent_extractions` or defaults
to `(num_cpus * 1.5).ceil()`.
Each file can optionally specify a `FileExtractionConfig` that overrides specific
fields from the batch-level `config`. Pass `null` for a file to use the batch defaults.
Batch-level settings like `max_concurrent_extractions` and `use_cache` are always
taken from the batch-level `config`.
per-file configuration overrides.
- `config` - Batch-level extraction configuration (provides defaults and batch settings)
**Returns:**
A vector of `ExtractionResult` in the same order as the input items.
**Errors:**
Individual file errors are captured in the result metadata. System errors
(IO, RuntimeError equivalents) will bubble up and fail the entire batch.
Simple usage with no per-file overrides:
Per-file configuration overrides:
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| -------- | --------------------- | -------- | --------------------------------------------------------------------------- |
| `items` | `List` | Yes | Vector of `BatchFileItem` structs, each containing a path and optional |
| `config` | `ExtractionConfig` | Yes | Batch-level extraction configuration (provides defaults and batch settings) |
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### batchExtractBytes()
Extract content from multiple byte arrays concurrently.
This function processes multiple byte arrays in parallel, automatically managing
concurrency to prevent resource exhaustion. The concurrency limit can be
configured via `ExtractionConfig.max_concurrent_extractions` or defaults
to `(num_cpus * 1.5).ceil()`.
Each item can optionally specify a `FileExtractionConfig` that overrides specific
fields from the batch-level `config`. Pass `null` as the config to use
the batch-level defaults for that item.
MIME type, and optional per-item configuration overrides.
- `config` - Batch-level extraction configuration
**Returns:**
A vector of `ExtractionResult` in the same order as the input items.
Simple usage with no per-item overrides:
Per-item configuration overrides:
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| -------- | ---------------------- | -------- | ------------------------------------------------------------------ |
| `items` | `List` | Yes | Vector of `BatchBytesItem` structs, each containing content bytes, |
| `config` | `ExtractionConfig` | Yes | Batch-level extraction configuration |
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### detectMimeTypeFromBytes()
Detect MIME type from raw file bytes.
Uses magic byte signatures to detect file type from content.
Falls back to `infer` crate for comprehensive detection.
For ZIP-based files, inspects contents to distinguish Office Open XML
formats (DOCX, XLSX, PPTX) from plain ZIP archives.
**Returns:**
The detected MIME type string.
**Errors:**
Returns `KreuzbergError.UnsupportedFormat` if MIME type cannot be determined.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| --------- | ----------- | -------- | -------------- |
| `content` | `ByteArray` | Yes | Raw file bytes |
**Returns:** `String`
**Errors:** Throws `Error`.
---
#### getExtensionsForMime()
Get file extensions for a given MIME type.
Returns all known file extensions that map to the specified MIME type.
**Returns:**
A vector of file extensions (without leading dot) for the MIME type.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| ---------- | -------- | -------- | ------------------------ |
| `mimeType` | `String` | Yes | The MIME type to look up |
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### listEmbeddingBackends()
List the names of all registered embedding backends.
Used by `kreuzberg-cli` and the api/mcp endpoints; excluded from the
language bindings via `alef.toml [exclude].functions`.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### listDocumentExtractors()
List names of all registered document extractors.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### listOcrBackends()
List all registered OCR backends.
Returns the names of all OCR backends currently registered in the global registry.
**Returns:**
A vector of OCR backend names.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### listPostProcessors()
List all registered post-processor names.
Returns a vector of all post-processor names currently registered in the
global registry.
**Returns:**
- `Ok(Vec)` - Vector of post-processor names
- `Err(...)` if the registry lock is poisoned
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### listRenderers()
List names of all registered renderers.
**Errors:**
Returns an error if the registry lock is poisoned.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### listValidators()
List names of all registered validators.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Returns:** `List`
**Errors:** Throws `Error`.
---
#### embedTextsAsync()
Generate embeddings asynchronously for a list of text strings.
This is the async counterpart to `embed_texts`. It offloads the blocking
ONNX inference work to a dedicated blocking thread pool via Tokio's
`spawn_blocking`, keeping the async executor free.
Returns one embedding vector per input text in the same order.
**Errors:**
- `KreuzbergError.MissingDependency` if ONNX Runtime is not installed
- `KreuzbergError.Embedding` if the preset name is unknown, model download fails,
or the blocking inference task panics
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| -------- | ----------------- | -------- | ----------------------------------------------------------------------- |
| `texts` | `List` | Yes | Vec of strings to embed (owned, sent to blocking thread) |
| `config` | `EmbeddingConfig` | Yes | Embedding configuration specifying model, batch size, and normalization |
**Returns:** `List>`
**Errors:** Throws `Error`.
---
#### renderPdfPageToPng()
Render a single PDF page to PNG bytes.
Returns raw PNG-encoded bytes for the specified page at the given DPI.
Uses pdf_oxide with tiny-skia for pure-Rust rendering.
**Errors:**
Returns `KreuzbergError.Parsing` if the PDF cannot be opened, authenticated,
or rendered, or if `page_index` is out of range.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| ----------- | ----------- | -------- | ------------------------------------------ |
| `pdfBytes` | `ByteArray` | Yes | Raw PDF file bytes |
| `pageIndex` | `Long` | Yes | Zero-based page index |
| `dpi` | `Int?` | No | Resolution in dots per inch (default: 150) |
| `password` | `String?` | No | Optional password for encrypted PDFs |
**Returns:** `ByteArray`
**Errors:** Throws `Error`.
---
#### detectMimeType()
Detect the MIME type of a file at the given path.
Uses the file extension and optionally the file content to determine the MIME type.
Set `check_exists` to `true` to verify the file exists before detection.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| ------------- | --------- | -------- | ---------------- |
| `path` | `String` | Yes | Path to the file |
| `checkExists` | `Boolean` | Yes | The check exists |
**Returns:** `String`
**Errors:** Throws `Error`.
---
#### embedTexts()
Embed a list of texts using the configured embedding model.
Returns a 2D vector where each inner vector is the embedding for the corresponding text.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| -------- | ----------------- | -------- | ------------------------- |
| `texts` | `List` | Yes | The texts |
| `config` | `EmbeddingConfig` | Yes | The configuration options |
**Returns:** `List>`
**Errors:** Throws `Error`.
---
#### getEmbeddingPreset()
Get an embedding preset by name.
Returns `null` if no preset with the given name exists. Returns an owned
clone so the value is safe to pass across FFI boundaries.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Parameters:**
| Name | Type | Required | Description |
| ------ | -------- | -------- | ----------- |
| `name` | `String` | Yes | The name |
**Returns:** `EmbeddingPreset?`
---
#### listEmbeddingPresets()
List the names of all available embedding presets.
Returns owned `String`s so the values are safe to pass across FFI boundaries.
**Signature:**
```kotlin
// Phase 1: kotlin backend signature generation
```
**Returns:** `List`
---
### Types
#### AccelerationConfig
Hardware acceleration configuration for ONNX Runtime models.
Controls which execution provider (CPU, CoreML, CUDA, TensorRT) is used
for inference in layout detection and embedding generation.
| Field | Type | Default | Description |
| ---------- | ----------------------- | ---------------------------- | --------------------------------------------------------------- |
| `provider` | `ExecutionProviderType` | `ExecutionProviderType.Auto` | Execution provider to use for ONNX inference. |
| `deviceId` | `Int` | — | GPU device ID (for CUDA/TensorRT). Ignored for CPU/CoreML/Auto. |
---
#### AnchorProperties
Properties for anchored drawings.
| Field | Type | Default | Description |
| ---------------- | --------- | ------- | --------------- |
| `behindDoc` | `Boolean` | — | Behind doc |
| `layoutInCell` | `Boolean` | — | Layout in cell |
| `relativeHeight` | `Long?` | `null` | Relative height |
| `positionH` | `String?` | `null` | Position h |
| `positionV` | `String?` | `null` | Position v |
| `wrapType` | `String` | — | Wrap type |
---
#### ApiDoc
OpenAPI documentation structure.
Defines all endpoints, request/response schemas, and examples
for the Kreuzberg document extraction API.
---
#### ArchiveEntry
A single file extracted from an archive.
When archives (ZIP, TAR, 7Z, GZIP) are extracted with recursive extraction
enabled, each processable file produces its own full `ExtractionResult`.
| Field | Type | Default | Description |
| ---------- | ------------------ | ------- | -------------------------------------------------------- |
| `path` | `String` | — | Archive-relative file path (e.g. "folder/document.pdf"). |
| `mimeType` | `String` | — | Detected MIME type of the file. |
| `result` | `ExtractionResult` | — | Full extraction result for this file. |
---
#### ArchiveMetadata
Archive (ZIP/TAR/7Z) metadata.
Extracted from compressed archive files containing file lists and size information.
| Field | Type | Default | Description |
| ---------------- | -------------- | ------- | ----------------------------------------- |
| `format` | `String` | — | Archive format ("ZIP", "TAR", "7Z", etc.) |
| `fileCount` | `Int` | — | Total number of files in the archive |
| `fileList` | `List` | `[]` | List of file paths within the archive |
| `totalSize` | `Long` | — | Total uncompressed size in bytes |
| `compressedSize` | `Long?` | `null` | Compressed size in bytes (if available) |
---
#### BBox
Bounding box in original image coordinates (x1, y1) top-left, (x2, y2) bottom-right.
| Field | Type | Default | Description |
| ----- | ------- | ------- | ----------- |
| `x1` | `Float` | — | X1 |
| `y1` | `Float` | — | Y1 |
| `x2` | `Float` | — | X2 |
| `y2` | `Float` | — | Y2 |
---
#### BatchBytesItem
Batch item for byte array extraction.
Used with `batch_extract_bytes` and `batch_extract_bytes_sync`
to represent a single item in a batch extraction job.
| Field | Type | Default | Description |
| ---------- | ----------------------- | ------- | ----------------------------------------------------------------- |
| `content` | `ByteArray` | — | The content bytes to extract from |
| `mimeType` | `String` | — | MIME type of the content (e.g., "application/pdf", "text/html") |
| `config` | `FileExtractionConfig?` | `null` | Per-item configuration overrides (None uses batch-level defaults) |
---
#### BatchFileItem
Batch item for file extraction.
Used with `batch_extract_files` and `batch_extract_files_sync`
to represent a single file in a batch extraction job.
| Field | Type | Default | Description |
| -------- | ----------------------- | ------- | ----------------------------------------------------------------- |
| `path` | `Path` | — | Path to the file to extract from |
| `config` | `FileExtractionConfig?` | `null` | Per-file configuration overrides (None uses batch-level defaults) |
---
#### BibtexMetadata
BibTeX bibliography metadata.
| Field | Type | Default | Description |
| -------------- | -------------------- | ------- | -------------------------------------- |
| `entryCount` | `Long` | — | Number of entries in the bibliography. |
| `citationKeys` | `List` | `[]` | Citation keys |
| `authors` | `List` | `[]` | Authors |
| `yearRange` | `YearRange?` | `null` | Year range (year range) |
| `entryTypes` | `Map?` | `{}` | Entry types |
---
#### ByteBufferPool
Convenience type alias for a pooled Vec.
---
#### CacheWarmParams
Request parameters for cache warm (model download).
| Field | Type | Default | Description |
| ---------------- | --------- | ------- | -------------------------------------------------------------------------------- |
| `allEmbeddings` | `Boolean` | — | Download all embedding model presets |
| `embeddingModel` | `String?` | `null` | Specific embedding preset name to download (e.g. "balanced", "speed", "quality") |
---
#### CharShape
| Field | Type | Default | Description |
| ----------- | --------- | ------- | ----------- |
| `bold` | `Boolean` | — | Bold |
| `italic` | `Boolean` | — | Italic |
| `underline` | `Boolean` | — | Underline |
---
#### Chunk
A text chunk with optional embedding and metadata.
Chunks are created when chunking is enabled in `ExtractionConfig`. Each chunk
contains the text content, optional embedding vector (if embedding generation
is configured), and metadata about its position in the document.
| Field | Type | Default | Description |
| ----------- | --------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `content` | `String` | — | The text content of this chunk. |
| `chunkType` | `ChunkType` | — | Semantic structural classification of this chunk. Assigned by the heuristic classifier based on content patterns and heading context. Defaults to `ChunkType.Unknown` when no rule matches. |
| `embedding` | `List?` | `null` | Optional embedding vector for this chunk. Only populated when `EmbeddingConfig` is provided in chunking configuration. The dimensionality depends on the chosen embedding model. |
| `metadata` | `ChunkMetadata` | — | Metadata about this chunk's position and properties. |
---
#### ChunkMetadata
Metadata about a chunk's position in the original document.
| Field | Type | Default | Description |
| ---------------- | ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `byteStart` | `Long` | — | Byte offset where this chunk starts in the original text (UTF-8 valid boundary). |
| `byteEnd` | `Long` | — | Byte offset where this chunk ends in the original text (UTF-8 valid boundary). |
| `tokenCount` | `Long?` | `null` | Number of tokens in this chunk (if available). This is calculated by the embedding model's tokenizer if embeddings are enabled. |
| `chunkIndex` | `Long` | — | Zero-based index of this chunk in the document. |
| `totalChunks` | `Long` | — | Total number of chunks in the document. |
| `firstPage` | `Int?` | `null` | First page number this chunk spans (1-indexed). Only populated when page tracking is enabled in extraction configuration. |
| `lastPage` | `Int?` | `null` | Last page number this chunk spans (1-indexed, equal to first_page for single-page chunks). Only populated when page tracking is enabled in extraction configuration. |
| `headingContext` | `HeadingContext?` | `null` | Heading context when using Markdown chunker. Contains the heading hierarchy this chunk falls under. Only populated when `ChunkerType.Markdown` is used. |
| `imageIndices` | `List` | — | Indices into `ExtractionResult.images` for images on pages covered by this chunk. Contains zero-based indices into the top-level `images` collection for every image whose `page_number` falls within `[first_page, last_page]`. Empty when image extraction is disabled or the chunk spans no pages with images. |
---
#### ChunkRequest
Chunk request with text and configuration.
| Field | Type | Default | Description |
| ------------- | --------- | ------- | ------------------------------------------------ |
| `text` | `String` | — | Text to chunk (must not be empty) |
| `config` | `String?` | `null` | Optional chunking configuration |
| `chunkerType` | `String` | — | Chunker type (text, markdown, yaml, or semantic) |
---
#### ChunkResponse
Chunk response with chunks and metadata.
| Field | Type | Default | Description |
| ---------------- | -------------- | ------- | ------------------------------- |
| `chunks` | `List` | — | List of chunks |
| `chunkCount` | `Long` | — | Total number of chunks |
| `config` | `String` | — | Configuration used for chunking |
| `inputSizeBytes` | `Long` | — | Input text size in bytes |
| `chunkerType` | `String` | — | Chunker type used for chunking |
---
#### ChunkTextParams
Request parameters for text chunking.
| Field | Type | Default | Description |
| ---------------- | --------- | ------- | ------------------------------------------------------------------------- |
| `text` | `String` | — | Text content to split into chunks |
| `maxCharacters` | `Long?` | `null` | Maximum characters per chunk (default: 2000) |
| `overlap` | `Long?` | `null` | Number of overlapping characters between chunks (default: 100) |
| `chunkerType` | `String?` | `null` | Chunker type: "text", "markdown", "yaml", or "semantic" (default: "text") |
| `topicThreshold` | `Float?` | `null` | Topic threshold for semantic chunking (0.0-1.0, default: 0.75) |
---
#### ChunkingConfig
Chunking configuration.
Configures text chunking for document content, including chunk size,
overlap, trimming behavior, and optional embeddings.
Use `..the default constructor` when constructing to allow for future field additions:
| Field | Type | Default | Description |
| ----------------------- | ------------------ | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `maxCharacters` | `Long` | `1000` | Maximum size per chunk (in units determined by `sizing`). When `sizing` is `Characters` (default), this is the max character count. When using token-based sizing, this is the max token count. Default: 1000 |
| `overlap` | `Long` | `200` | Overlap between chunks (in units determined by `sizing`). Default: 200 |
| `trim` | `Boolean` | `true` | Whether to trim whitespace from chunk boundaries. Default: true |
| `chunkerType` | `ChunkerType` | `ChunkerType.Text` | Type of chunker to use (Text or Markdown). Default: Text |
| `embedding` | `EmbeddingConfig?` | `null` | Optional embedding configuration for chunk embeddings. |
| `preset` | `String?` | `null` | Use a preset configuration (overrides individual settings if provided). |
| `sizing` | `ChunkSizing` | `ChunkSizing.Characters` | How to measure chunk size. Default: `Characters` (Unicode character count). Enable `chunking-tiktoken` or `chunking-tokenizers` features for token-based sizing. |
| `prependHeadingContext` | `Boolean` | `false` | When `true` and `chunker_type` is `Markdown`, prepend the heading hierarchy path (e.g. `"# Title > ## Section\n\n"`) to each chunk's content string. This is useful for RAG pipelines where each chunk needs self-contained context about its position in the document structure. Default: `false` |
| `topicThreshold` | `Float?` | `null` | Optional cosine similarity threshold for semantic topic boundary detection. Only used when `chunker_type` is `Semantic` and an `EmbeddingConfig` is provided. You almost never need to set this. When omitted, defaults to `0.75` which works well for most documents. Lower values detect more topic boundaries (more, smaller chunks); higher values detect fewer. Range: `0.0..=1.0`. |
##### Methods
###### default()
**Signature:**
```kotlin
// Phase 1: kotlin backend method signature generation
```
---
#### ChunkingResult
Result of a text chunking operation.
Contains the generated chunks and metadata about the chunking.
| Field | Type | Default | Description |
| ------------ | ------------- | ------- | -------------------------------- |
| `chunks` | `List` | — | List of text chunks |
| `chunkCount` | `Long` | — | Total number of chunks generated |
---
#### CitationMetadata
Citation file metadata (RIS, PubMed, EndNote).
| Field | Type | Default | Description |
| --------------- | -------------- | ------- | ----------------------- |
| `citationCount` | `Long` | — | Number of citations |
| `format` | `String?` | `null` | Format |
| `authors` | `List` | `[]` | Authors |
| `yearRange` | `YearRange?` | `null` | Year range (year range) |
| `dois` | `List` | `[]` | Dois |
| `keywords` | `List` | `[]` | Keywords |
---
#### ContentFilterConfig
Cross-extractor content filtering configuration.
Controls whether "furniture" content (headers, footers, page numbers,
watermarks, repeating text) is included in or stripped from extraction
results. Applies across all extractors (PDF, DOCX, RTF, ODT, HTML, etc.)
with format-specific implementation.
When `null` on `ExtractionConfig`, each extractor uses its current
default behavior unchanged.
| Field | Type | Default | Description |
| -------------------- | --------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `includeHeaders` | `Boolean` | `false` | Include running headers in extraction output. - PDF: Disables top-margin furniture stripping and prevents the layout model from treating `PageHeader`-classified regions as furniture. - DOCX: Includes document headers in text output. - RTF/ODT: Headers already included; this is a no-op when true. - HTML/EPUB: Keeps `` element content. Default: `false` (headers are stripped or excluded). |
| `includeFooters` | `Boolean` | `false` | Include running footers in extraction output. - PDF: Disables bottom-margin furniture stripping and prevents the layout model from treating `PageFooter`-classified regions as furniture. - DOCX: Includes document footers in text output. - RTF/ODT: Footers already included; this is a no-op when true. - HTML/EPUB: Keeps `