Class DefaultContentFormatter.Builder

java.lang.Object
org.springframework.ai.document.DefaultContentFormatter.Builder
Enclosing class:
DefaultContentFormatter

public static class DefaultContentFormatter.Builder extends Object
  • Method Details

    • from

    • withMetadataTemplate

      public DefaultContentFormatter.Builder withMetadataTemplate(String metadataTemplate)
      Configures the Document metadata template.
      Parameters:
      metadataTemplate - Metadata template to use.
      Returns:
      this builder
    • withMetadataSeparator

      public DefaultContentFormatter.Builder withMetadataSeparator(String metadataSeparator)
      Configures the Document metadata separator.
      Parameters:
      metadataSeparator - Metadata separator to use.
      Returns:
      this builder
    • withTextTemplate

      public DefaultContentFormatter.Builder withTextTemplate(String textTemplate)
      Configures the Document text template.
      Parameters:
      textTemplate - Document's content template.
      Returns:
      this builder
    • withExcludedInferenceMetadataKeys

      public DefaultContentFormatter.Builder withExcludedInferenceMetadataKeys(List<String> excludedInferenceMetadataKeys)
      Configures the excluded Inference metadata keys to filter out from the generative.
      Parameters:
      excludedInferenceMetadataKeys - Excluded inference metadata keys to use.
      Returns:
      this builder
    • withExcludedInferenceMetadataKeys

      public DefaultContentFormatter.Builder withExcludedInferenceMetadataKeys(String... keys)
    • withExcludedEmbedMetadataKeys

      public DefaultContentFormatter.Builder withExcludedEmbedMetadataKeys(List<String> excludedEmbedMetadataKeys)
      Configures the excluded Embed metadata keys to filter out from the generative.
      Parameters:
      excludedEmbedMetadataKeys - Excluded Embed metadata keys to use.
      Returns:
      this builder
    • withExcludedEmbedMetadataKeys

      public DefaultContentFormatter.Builder withExcludedEmbedMetadataKeys(String... keys)
    • build

      public DefaultContentFormatter build()
      Returns the immutable configuration.
      Returns:
      the immutable configuration