Class RetrievalAugmentorConfiguration

java.lang.Object
io.micronaut.langchain4j.rag.RetrievalAugmentorConfiguration

@EachProperty("langchain4j.rag.retrieval-augmentors") public final class RetrievalAugmentorConfiguration extends Object
Configures a DefaultRetrievalAugmentor that retrieves content from one or more content retrievers and, with a scoring model, re-ranks it. The retrieval augmentor bean is named after the configuration, so that the AiService with that name uses it.
Since:
2.4.0
  • Field Details

  • Constructor Details

    • RetrievalAugmentorConfiguration

      public RetrievalAugmentorConfiguration(@Parameter String name)
      Parameters:
      name - The name of the retrieval augmentor
  • Method Details

    • getName

      public String getName()
      Returns:
      The name of the retrieval augmentor
    • getContentRetrievers

      public List<String> getContentRetrievers()
      Returns:
      The names of the content retriever beans
    • setContentRetrievers

      public void setContentRetrievers(List<String> contentRetrievers)
      Parameters:
      contentRetrievers - The names of the content retriever beans the content is retrieved from. Defaults to the content retriever named after the retrieval augmentor, otherwise the default content retriever.
    • getScoringModel

      public @Nullable String getScoringModel()
      Returns:
      The name of the scoring model bean that re-ranks the content
    • setScoringModel

      public void setScoringModel(@Nullable String scoringModel)
      Parameters:
      scoringModel - The name of the scoring model bean that re-ranks the content. Setting it enables re-ranking.
    • isReRank

      public boolean isReRank()
      Returns:
      Whether the content is re-ranked
    • setReRank

      public void setReRank(boolean reRank)
      Parameters:
      reRank - Whether the content is re-ranked with the default scoring model. Defaults to false, unless a scoring model is named.
    • getMinScore

      public @Nullable Double getMinScore()
      Returns:
      The minimum score of the re-ranked content
    • setMinScore

      public void setMinScore(@Nullable Double minScore)
      Parameters:
      minScore - The minimum score, given by the scoring model, of the content passed to the model
    • getMaxResults

      public @Nullable Integer getMaxResults()
      Returns:
      The maximum number of re-ranked contents passed to the model
    • setMaxResults

      public void setMaxResults(@Nullable Integer maxResults)
      Parameters:
      maxResults - The maximum number of re-ranked contents passed to the model. No maximum by default.