Class MongoVectorStoreConfig.Builder
java.lang.Object
com.google.genkit.plugins.mongodb.MongoVectorStoreConfig.Builder
- Enclosing class:
MongoVectorStoreConfig
Builder for
MongoVectorStoreConfig.-
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalMetadata(String key, Object value) Adds a metadata entry merged into every indexed document.build()Builds a newMongoVectorStoreConfig.collectionName(String collectionName) Sets the collection name.createIndexIfNotExists(boolean createIndexIfNotExists) Sets whether to create the Atlas Vector Search index on first use if it does not exist.databaseName(String databaseName) Sets the database name.dimension(int dimension) Sets the embedding dimension.embedderName(String embedderName) Sets the embedder name.embeddingField(String embeddingField) Sets the embedding field name.Sets the Atlas Vector Search index name.numCandidates(int numCandidates) Sets the number of nearest neighbors to consider during the vector search.similarity(MongoVectorStoreConfig.Similarity similarity) Sets the vector similarity function.Sets the text field name.
-
Method Details
-
databaseName
Sets the database name.- Parameters:
databaseName- the database name- Returns:
- this builder
-
collectionName
Sets the collection name.- Parameters:
collectionName- the collection name- Returns:
- this builder
-
embedderName
Sets the embedder name.- Parameters:
embedderName- the embedder name- Returns:
- this builder
-
indexName
Sets the Atlas Vector Search index name.- Parameters:
indexName- the index name- Returns:
- this builder
-
dimension
Sets the embedding dimension.- Parameters:
dimension- the embedding dimension (must be>= 1)- Returns:
- this builder
-
similarity
Sets the vector similarity function.- Parameters:
similarity- the similarity- Returns:
- this builder
-
textField
Sets the text field name.- Parameters:
textField- the text field name- Returns:
- this builder
-
embeddingField
Sets the embedding field name.- Parameters:
embeddingField- the embedding field name- Returns:
- this builder
-
numCandidates
Sets the number of nearest neighbors to consider during the vector search.- Parameters:
numCandidates- the number of candidates (must be>= 1)- Returns:
- this builder
-
createIndexIfNotExists
Sets whether to create the Atlas Vector Search index on first use if it does not exist.- Parameters:
createIndexIfNotExists- whether to create the index when missing- Returns:
- this builder
-
addAdditionalMetadata
Adds a metadata entry merged into every indexed document.- Parameters:
key- the metadata keyvalue- the metadata value- Returns:
- this builder
-
build
Builds a newMongoVectorStoreConfig.- Returns:
- a new config instance
-