Class CoherenceEmbeddingStore.Builder
java.lang.Object
dev.langchain4j.store.embedding.coherence.CoherenceEmbeddingStore.Builder
- Enclosing class:
CoherenceEmbeddingStore
A builder to create
CoherenceEmbeddingStore
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build aCoherenceEmbeddingStore
from the state in this builder.index
(com.oracle.coherence.ai.VectorIndexExtractor<com.oracle.coherence.ai.DocumentChunk, com.oracle.coherence.ai.Vector<?>> extractor) Set the vector index to add to the underlyingNamedMap
.Set the name of theNamedMap
that will hold thedocument chunks
.normalizeEmbeddings
(boolean f) Set whether to force normalization of vectors on adding and searching.session
(com.tangosol.net.Session session) Set theSession
to use to obtain the document chunkNamedMap
.Set the name of theSession
to use to obtain the document chunkNamedMap
.
-
Constructor Details
-
Builder
protected Builder()Create aCoherenceEmbeddingStore.Builder
.
-
-
Method Details
-
name
Set the name of theNamedMap
that will hold thedocument chunks
.- Parameters:
name
- the name of theNamedMap
that will hold thedocument chunks
- Returns:
- this builder for fluent method calls
-
session
Set the name of theSession
to use to obtain the document chunkNamedMap
.- Parameters:
sessionName
- the session name- Returns:
- this builder for fluent method calls
-
session
Set theSession
to use to obtain the document chunkNamedMap
.- Parameters:
session
- theSession
to use- Returns:
- this builder for fluent method calls
-
index
public CoherenceEmbeddingStore.Builder index(com.oracle.coherence.ai.VectorIndexExtractor<com.oracle.coherence.ai.DocumentChunk, com.oracle.coherence.ai.Vector<?>> extractor) Set the vector index to add to the underlyingNamedMap
.- Parameters:
extractor
- theVectorIndexExtractor
to use to create the index- Returns:
- this builder for fluent method calls
-
normalizeEmbeddings
Set whether to force normalization of vectors on adding and searching.- Parameters:
f
-true
if theCoherenceEmbeddingStore
should call forceEmbedding.normalize()
on embeddings when adding or searching- Returns:
- this builder for fluent method calls
-
build
Build aCoherenceEmbeddingStore
from the state in this builder.- Returns:
- a new instance of a
CoherenceEmbeddingStore
-