Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add milvus init args support #1961

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mem0/vector_stores/milvus.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def __init__(
collection_name: str,
embedding_model_dims: int,
metric_type: MetricType,
db_name: str = "",
user: str = "",
password: str = "",
) -> None:
"""Initialize the MilvusDB database.

Expand All @@ -39,11 +42,14 @@ def __init__(
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 "").
user (str): User for the database (defaults to "").
password (str): Password for 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, user=user, password=password)
self.create_col(
collection_name=self.collection_name,
vector_size=self.embedding_model_dims,
Expand Down
Loading