Class EmbeddingStoreIngestor.Builder
java.lang.Object
dev.langchain4j.store.embedding.EmbeddingStoreIngestor.Builder
- Enclosing class:
EmbeddingStoreIngestor
EmbeddingStoreIngestor builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the EmbeddingStoreIngestor.documentSplitter(DocumentSplitter documentSplitter) Sets the document splitter.documentTransformer(DocumentTransformer documentTransformer) Sets the document transformer.embeddingInputType(EmbeddingInputType embeddingInputType) Embeds the text segments with the givenEmbeddingInputType(typicallyEmbeddingInputType.DOCUMENT), so providers that encode queries and documents differently can produce a document-optimized embedding.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
-
embeddingInputType
Embeds the text segments with the givenEmbeddingInputType(typicallyEmbeddingInputType.DOCUMENT), so providers that encode queries and documents differently can produce a document-optimized embedding.When left
null(the default), no input type is sent. If set, the chosenEmbeddingModelmustsupportthe input type parameter, otherwise ingestion fails fast.- Parameters:
embeddingInputType- the input type to embed documents with.- Returns:
this
-
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.
-