feat: Add db_name field to MilvusDBConfig and MilvusDB initialization (#3229)

This commit is contained in:
Vimpas
2025-08-05 11:16:34 -07:00
committed by GitHub
parent 7fac6311f4
commit 7a0dc7391e
4 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -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,