Class HybridChunkerOptions.Builder

java.lang.Object
ai.docling.serve.api.chunk.request.options.HybridChunkerOptions.Builder
Enclosing class:
HybridChunkerOptions

public static class HybridChunkerOptions.Builder extends Object
Builder for creating HybridChunkerOptions instances. Generated by Lombok's @Builder annotation.

Builder methods:

  • useMarkdownTables(boolean) - Set whether to use markdown table format
  • includeRawText(boolean) - Set whether to include raw text in response
  • maxTokens(Integer) - Set the maximum number of tokens per chunk
  • tokenizer(String) - Set the HuggingFace model name for tokenization
  • mergePeers(Boolean) - Set whether to merge undersized successive chunks
  • Method Details

    • useMarkdownTables

      public @NonNull HybridChunkerOptions.Builder useMarkdownTables(boolean useMarkdownTables)
      Use markdown table format instead of triplets for table serialization.
      Parameters:
      useMarkdownTables - true if markdown tables should be used, false otherwise
      Returns:
      this.
    • includeRawText

      public @NonNull HybridChunkerOptions.Builder includeRawText(boolean includeRawText)
      Include both raw_text and text (contextualized) in response. If False, only text is included.
      Parameters:
      includeRawText - true if raw text should be included, false otherwise
      Returns:
      this.
    • maxTokens

      public @NonNull HybridChunkerOptions.Builder maxTokens(@Nullable Integer maxTokens)
      Maximum number of tokens per chunk. When left to none, the value is automatically extracted from the tokenizer.
      Parameters:
      maxTokens - the maximum number of tokens per chunk, or null if not specified
      Returns:
      this.
    • tokenizer

      public @NonNull HybridChunkerOptions.Builder tokenizer(@Nullable String tokenizer)
      HuggingFace model name for custom tokenization. If not specified, uses 'sentence-transformers/all-MiniLM-L6-v2' as default.
      Parameters:
      tokenizer - the tokenizer model name, or null to use the default
      Returns:
      this.
    • mergePeers

      public @NonNull HybridChunkerOptions.Builder mergePeers(Boolean mergePeers)
      Merge undersized successive chunks with same headings.
      Parameters:
      mergePeers - true if chunks should be merged, false otherwise, or null if not specified
      Returns:
      this.
    • build

      public @NonNull HybridChunkerOptions build()
    • toString

      public @NonNull String toString()
      Overrides:
      toString in class Object