Class DefaultContentFormatter

java.lang.Object
org.springframework.ai.document.DefaultContentFormatter
All Implemented Interfaces:
ContentFormatter

public final class DefaultContentFormatter extends Object implements ContentFormatter
Default implementation of ContentFormatter.
Author:
Christian Tzolov
  • Method Details

    • builder

      public static DefaultContentFormatter.Builder builder()
      Start building a new configuration.
      Returns:
      The entry point for creating a new configuration.
    • defaultConfig

      public static DefaultContentFormatter defaultConfig()
      Returns the default config.
      Returns:
      the default config
    • format

      public String format(Document document, MetadataMode metadataMode)
      Specified by:
      format in interface ContentFormatter
    • metadataFilter

      protected Map<String,Object> metadataFilter(Map<String,Object> metadata, MetadataMode metadataMode)
      Filters the metadata by the configured MetadataMode.
      Parameters:
      metadata - Document metadata.
      Returns:
      Returns the filtered by configured mode metadata.
    • getMetadataTemplate

      public String getMetadataTemplate()
    • getMetadataSeparator

      public String getMetadataSeparator()
    • getTextTemplate

      public String getTextTemplate()
    • getExcludedInferenceMetadataKeys

      public List<String> getExcludedInferenceMetadataKeys()
    • getExcludedEmbedMetadataKeys

      public List<String> getExcludedEmbedMetadataKeys()