Package dev.langchain4j.store.embedding
Class EmbeddingStoreIngestor.Builder
java.lang.Object
dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
- Enclosing class:
EmbeddingStoreIngestor
EmbeddingStoreIngestor builder.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the EmbeddingStoreIngestor.documentSplitter
(DocumentSplitter documentSplitter) Sets the document splitter.documentTransformer
(DocumentTransformer documentTransformer) Sets the document transformer.embeddingModel
(EmbeddingModel embeddingModel) Sets the embedding model.embeddingStore
(EmbeddingStore<TextSegment> embeddingStore) Sets the embedding store.textSegmentTransformer
(TextSegmentTransformer textSegmentTransformer) Sets the text segment transformer.
-
Constructor Details
-
Builder
public Builder()Creates a new EmbeddingStoreIngestor builder.
-
-
Method Details
-
documentTransformer
Sets the document transformer. Optional.- Parameters:
documentTransformer
- the document transformer.- Returns:
this
-
documentSplitter
Sets the document splitter. Optional. If none is specified, it tries to load one through SPI (seeDocumentSplitterFactory
).
DocumentSplitters.recursive()
from main (langchain4j
) module is a good starting point.- Parameters:
documentSplitter
- the document splitter.- Returns:
this
-
textSegmentTransformer
public EmbeddingStoreIngestor.Builder textSegmentTransformer(TextSegmentTransformer textSegmentTransformer) Sets the text segment transformer. Optional.- Parameters:
textSegmentTransformer
- the text segment transformer.- Returns:
this
-
embeddingModel
Sets the embedding model. Mandatory. If none is specified, it tries to load one through SPI (seeEmbeddingModelFactory
).- Parameters:
embeddingModel
- the embedding model.- Returns:
this
-
embeddingStore
Sets the embedding store. Mandatory.- Parameters:
embeddingStore
- the embedding store.- Returns:
this
-
build
Builds the EmbeddingStoreIngestor.- Returns:
- the EmbeddingStoreIngestor.
-