Class ConcatenationDocumentJoiner

java.lang.Object
com.bytedesk.ai.springai.rag.ConcatenationDocumentJoiner
All Implemented Interfaces:
Function<Map<org.springframework.ai.rag.Query,List<List<org.springframework.ai.document.Document>>>,List<org.springframework.ai.document.Document>>, org.springframework.ai.rag.retrieval.join.DocumentJoiner

public class ConcatenationDocumentJoiner extends Object implements org.springframework.ai.rag.retrieval.join.DocumentJoiner
ConcatenationDocumentJoiner Pre-Retrieval: DocumentJoiner https://java2ai.com/blog/spring-ai-alibaba-module-rag/?spm=0.29160081.0.0.75c73b5blqQmqQ
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private List<String>
    extractKeys(org.springframework.ai.document.Document document)
     
    @NotNull List<org.springframework.ai.document.Document>
    join(Map<org.springframework.ai.rag.Query,List<List<org.springframework.ai.document.Document>>> documentsForQuery)
     
    private Map<org.springframework.ai.rag.Query,List<List<org.springframework.ai.document.Document>>>
    selectDocuments(Map<org.springframework.ai.rag.Query,List<List<org.springframework.ai.document.Document>>> documentsForQuery, int totalDocuments)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.ai.rag.retrieval.join.DocumentJoiner

    apply

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Constructor Details

    • ConcatenationDocumentJoiner

      public ConcatenationDocumentJoiner()
  • Method Details

    • join

      @NotNull public @NotNull List<org.springframework.ai.document.Document> join(@Nullable Map<org.springframework.ai.rag.Query,List<List<org.springframework.ai.document.Document>>> documentsForQuery)
      Specified by:
      join in interface org.springframework.ai.rag.retrieval.join.DocumentJoiner
    • selectDocuments

      private Map<org.springframework.ai.rag.Query,List<List<org.springframework.ai.document.Document>>> selectDocuments(Map<org.springframework.ai.rag.Query,List<List<org.springframework.ai.document.Document>>> documentsForQuery, int totalDocuments)
    • extractKeys

      private List<String> extractKeys(org.springframework.ai.document.Document document)