Class IngestionConfiguration
java.lang.Object
io.micronaut.langchain4j.rag.IngestionConfiguration
Configures the ingestion of documents into an embedding store: the documents are loaded from the sources, split
into segments, embedded with the embedding model and stored. An
EmbeddingStoreIngestor bean named after the configuration is created to
ingest other documents.- Since:
- 2.4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable String@Nullable StringgetGlob()intintgetName()booleanbooleanvoidsetEmbeddingModel(@Nullable String embeddingModel) voidsetEmbeddingStore(@Nullable String embeddingStore) voidvoidsetIngestOnStartup(boolean ingestOnStartup) voidsetMaxOverlapSize(int maxOverlapSize) voidsetMaxSegmentSize(int maxSegmentSize) voidsetRecursive(boolean recursive) voidsetSources(List<String> sources)
-
Field Details
-
PREFIX
-
DEFAULT_MAX_SEGMENT_SIZE
public static final int DEFAULT_MAX_SEGMENT_SIZEThe default maximum size of a segment, in characters.- See Also:
-
DEFAULT_MAX_OVERLAP_SIZE
public static final int DEFAULT_MAX_OVERLAP_SIZEThe default maximum overlap of two segments, in characters.- See Also:
-
DEFAULT_GLOB
-
-
Constructor Details
-
IngestionConfiguration
- Parameters:
name- The name of the ingestion
-
-
Method Details
-
getSources
-
setSources
-
getGlob
- Returns:
- The glob the documents match
-
setGlob
-
isRecursive
public boolean isRecursive()- Returns:
- Whether the documents of the sub-directories of the file system sources are loaded
-
setRecursive
public void setRecursive(boolean recursive) - Parameters:
recursive- Whether the documents of the sub-directories of the file system sources are loaded. Defaults totrue.
-
getMaxSegmentSize
public int getMaxSegmentSize()- Returns:
- The maximum size of a segment, in characters
-
setMaxSegmentSize
public void setMaxSegmentSize(int maxSegmentSize) - Parameters:
maxSegmentSize- The maximum size of a segment, in characters. Defaults to 1000.
-
getMaxOverlapSize
public int getMaxOverlapSize()- Returns:
- The maximum overlap of two consecutive segments, in characters
-
setMaxOverlapSize
public void setMaxOverlapSize(int maxOverlapSize) - Parameters:
maxOverlapSize- The maximum overlap of two consecutive segments, in characters. Defaults to 100.
-
isIngestOnStartup
public boolean isIngestOnStartup()- Returns:
- Whether the documents of the sources are ingested when the application starts
-
setIngestOnStartup
public void setIngestOnStartup(boolean ingestOnStartup) - Parameters:
ingestOnStartup- Whether the documents of the sources are ingested when the application starts. Defaults totrue.
-
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.
-