Class ContentRetrieverConfiguration
java.lang.Object
io.micronaut.langchain4j.rag.ContentRetrieverConfiguration
@EachProperty("langchain4j.rag.content-retrievers")
public final class ContentRetrieverConfiguration
extends Object
Configures a
EmbeddingStoreContentRetriever that retrieves the
segments of an embedding store relevant to the user message. The content retriever bean is named after the
configuration, so that the AiService with that name uses it.- Since:
- 2.4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default maximum number of results.static final StringThe configuration prefix. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable String@Nullable Stringint@Nullable DoublegetName()voidsetEmbeddingModel(@Nullable String embeddingModel) voidsetEmbeddingStore(@Nullable String embeddingStore) voidsetMaxResults(int maxResults) voidsetMinScore(@Nullable Double minScore)
-
Field Details
-
PREFIX
-
DEFAULT_MAX_RESULTS
public static final int DEFAULT_MAX_RESULTSThe default maximum number of results.- See Also:
-
-
Constructor Details
-
ContentRetrieverConfiguration
- Parameters:
name- The name of the content retriever
-
-
Method Details
-
getMaxResults
public int getMaxResults()- Returns:
- The maximum number of segments retrieved
-
setMaxResults
public void setMaxResults(int maxResults) - Parameters:
maxResults- The maximum number of segments retrieved. Defaults to 3.
-
getMinScore
- Returns:
- The minimum relevance score of the segments retrieved
-
setMinScore
- Parameters:
minScore- The minimum relevance score (between 0 and 1) of the segments retrieved. No minimum by default.
-
getName
- Returns:
- The name of the configuration, which is the name of the bean it configures
-
getEmbeddingStore
- Returns:
- The name of the embedding store bean, or
nullfor the default embedding store
-
setEmbeddingStore
- Parameters:
embeddingStore- The name of the embedding store bean. Defaults to the default embedding store.
-
getEmbeddingModel
- Returns:
- The name of the embedding model bean, or
nullfor the default embedding model
-
setEmbeddingModel
- Parameters:
embeddingModel- The name of the embedding model bean. Defaults to the default embedding model.
-