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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Integer@Nullable DoublegetName()@Nullable StringbooleanisReRank()voidsetContentRetrievers(List<String> contentRetrievers) voidsetMaxResults(@Nullable Integer maxResults) voidsetMinScore(@Nullable Double minScore) voidsetReRank(boolean reRank) voidsetScoringModel(@Nullable String scoringModel)
-
Field Details
-
PREFIX
-
-
Constructor Details
-
RetrievalAugmentorConfiguration
- Parameters:
name- The name of the retrieval augmentor
-
-
Method Details
-
getName
- Returns:
- The name of the retrieval augmentor
-
getContentRetrievers
-
setContentRetrievers
-
getScoringModel
- Returns:
- The name of the scoring model bean that re-ranks the content
-
setScoringModel
- 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 tofalse, unless a scoring model is named.
-
getMinScore
- Returns:
- The minimum score of the re-ranked content
-
setMinScore
- Parameters:
minScore- The minimum score, given by the scoring model, of the content passed to the model
-
getMaxResults
- Returns:
- The maximum number of re-ranked contents passed to the model
-
setMaxResults
- Parameters:
maxResults- The maximum number of re-ranked contents passed to the model. No maximum by default.
-