feat: Add db_name field to MilvusDBConfig and MilvusDB initialization (#3229)
This commit is contained in:
@@ -30,6 +30,7 @@ class MilvusDB(VectorStoreBase):
|
||||
collection_name: str,
|
||||
embedding_model_dims: int,
|
||||
metric_type: MetricType,
|
||||
db_name: str,
|
||||
) -> None:
|
||||
"""Initialize the MilvusDB database.
|
||||
|
||||
@@ -39,11 +40,12 @@ class MilvusDB(VectorStoreBase):
|
||||
collection_name (str): Name of the collection (defaults to mem0).
|
||||
embedding_model_dims (int): Dimensions of the embedding model (defaults to 1536).
|
||||
metric_type (MetricType): Metric type for similarity search (defaults to L2).
|
||||
db_name (str): Name of the database (defaults to "").
|
||||
"""
|
||||
self.collection_name = collection_name
|
||||
self.embedding_model_dims = embedding_model_dims
|
||||
self.metric_type = metric_type
|
||||
self.client = MilvusClient(uri=url, token=token)
|
||||
self.client = MilvusClient(uri=url, token=token, db_name=db_name)
|
||||
self.create_col(
|
||||
collection_name=self.collection_name,
|
||||
vector_size=self.embedding_model_dims,
|
||||
|
||||
Reference in New Issue
Block a user