From 7a95df008ee4d4ee23482e895c1c326706163a8a Mon Sep 17 00:00:00 2001 From: Sajid Ali Date: Tue, 14 Jan 2025 14:08:11 -0500 Subject: [PATCH] Milvus: add new config var, MILVUS_DB modified: backend/open_webui/config.py modified: backend/open_webui/retrieval/vector/dbs/milvus.py --- backend/open_webui/config.py | 1 + backend/open_webui/retrieval/vector/dbs/milvus.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index ea8de959b..310f83a39 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -1193,6 +1193,7 @@ CHROMA_HTTP_SSL = os.environ.get("CHROMA_HTTP_SSL", "false").lower() == "true" # Milvus MILVUS_URI = os.environ.get("MILVUS_URI", f"{DATA_DIR}/vector_db/milvus.db") +MILVUS_DB = os.environ.get("MILVUS_DB", "default") # Qdrant QDRANT_URI = os.environ.get("QDRANT_URI", None) diff --git a/backend/open_webui/retrieval/vector/dbs/milvus.py b/backend/open_webui/retrieval/vector/dbs/milvus.py index 31d890664..22bb87f3a 100644 --- a/backend/open_webui/retrieval/vector/dbs/milvus.py +++ b/backend/open_webui/retrieval/vector/dbs/milvus.py @@ -6,14 +6,14 @@ from typing import Optional from open_webui.retrieval.vector.main import VectorItem, SearchResult, GetResult from open_webui.config import ( - MILVUS_URI, + MILVUS_URI, MILVUS_DB, ) class MilvusClient: def __init__(self): self.collection_prefix = "open_webui" - self.client = Client(uri=MILVUS_URI) + self.client = Client(uri=MILVUS_URI, database=MILVUS_DB) def _result_to_get_result(self, result) -> GetResult: ids = []