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 Details

  • Constructor Details

    • ContentRetrieverConfiguration

      public ContentRetrieverConfiguration(@Parameter String name)
      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

      public @Nullable Double getMinScore()
      Returns:
      The minimum relevance score of the segments retrieved
    • setMinScore

      public void setMinScore(@Nullable Double minScore)
      Parameters:
      minScore - The minimum relevance score (between 0 and 1) of the segments retrieved. No minimum by default.
    • getName

      public String getName()
      Returns:
      The name of the configuration, which is the name of the bean it configures
    • getEmbeddingStore

      public @Nullable String getEmbeddingStore()
      Returns:
      The name of the embedding store bean, or null for the default embedding store
    • setEmbeddingStore

      public void setEmbeddingStore(@Nullable String embeddingStore)
      Parameters:
      embeddingStore - The name of the embedding store bean. Defaults to the default embedding store.
    • getEmbeddingModel

      public @Nullable String getEmbeddingModel()
      Returns:
      The name of the embedding model bean, or null for the default embedding model
    • setEmbeddingModel

      public void setEmbeddingModel(@Nullable String embeddingModel)
      Parameters:
      embeddingModel - The name of the embedding model bean. Defaults to the default embedding model.