Class AzureCosmosDbMongoVCoreEmbeddingStore.Builder
java.lang.Object
dev.langchain4j.store.embedding.azure.cosmos.mongo.vcore.AzureCosmosDbMongoVCoreEmbeddingStore.Builder
- Enclosing class:
AzureCosmosDbMongoVCoreEmbeddingStore
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplicationName
(String applicationName) build()
collectionName
(String collectionName) connectionString
(String connectionString) Sets the Azure CosmosDB Mongo vCore connectionString.createCollectionOptions
(com.mongodb.client.model.CreateCollectionOptions createCollectionOptions) createIndex
(Boolean createIndex) Set to true if you want the application to create an index, or false if you want to create it manually.databaseName
(String databaseName) dimensions
(Integer dimensions) efConstruction
(Integer efConstruction) mongoClient
(com.mongodb.client.MongoClient mongoClient) Build Mongo Client, Please close the client to release resources after usage.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
mongoClient
public AzureCosmosDbMongoVCoreEmbeddingStore.Builder mongoClient(com.mongodb.client.MongoClient mongoClient) Build Mongo Client, Please close the client to release resources after usage. This is a mandatory parameter if not providing the connectionString. -
connectionString
Sets the Azure CosmosDB Mongo vCore connectionString. This is a mandatory parameter if not providing the Mongo Client.- Parameters:
connectionString
- The Azure CosmosDB Mongo vCore connectionString.- Returns:
- builder
-
databaseName
-
collectionName
-
indexName
-
applicationName
-
createCollectionOptions
public AzureCosmosDbMongoVCoreEmbeddingStore.Builder createCollectionOptions(com.mongodb.client.model.CreateCollectionOptions createCollectionOptions) -
createIndex
Set to true if you want the application to create an index, or false if you want to create it manually.default value is false
- Parameters:
createIndex
- whether in production mode- Returns:
- builder
-
kind
- Parameters:
kind
- - Type of vector index to create. Possible options are: - vector-ivf - vector-hnsw: available as a preview feature only, to enable visit https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/preview-feature
-
numLists
- Parameters:
numLists
- - This integer is the number of clusters that the inverted file (IVF) index uses to group the vector data. We recommend that numLists is set to documentCount/1000 for up to 1 million documents and to sqrt(documentCount) for more than 1 million documents. Using a numLists value of 1 is akin to performing brute-force search, which has limited performance.- Returns:
-
dimensions
- Parameters:
dimensions
- - Number of dimensions for vector similarity. The maximum number of supported dimensions is 2000.- Returns:
-
m
- Parameters:
m
- - The max number of connections per layer (16 by default, minimum value is 2, maximum value is 100). Higher m is suitable for datasets with high dimensionality and/or high accuracy requirements.- Returns:
-
efConstruction
- Parameters:
efConstruction
- - the size of the dynamic candidate list for constructing the graph (64 by default, minimum value is 4, maximum value is 1000). Higher ef_construction will result in better index quality and higher accuracy, but it will also increase the time required to build the index. ef_construction has to be at least 2 * m.- Returns:
-
efSearch
- Parameters:
efSearch
- - The size of the dynamic candidate list for search (40 by default). A higher value provides better recall at the cost of speed.- Returns:
-
build
-