From 2f33b3bb7e10339a40d4ccf990cc5617bde967f5 Mon Sep 17 00:00:00 2001 From: Thunder <1639908@qq.com> Date: Wed, 23 Oct 2024 15:58:31 +0800 Subject: [PATCH] add db name of milvus --- .env.template | 5 +++-- dbgpt/_private/config.py | 1 + dbgpt/storage/vector_store/milvus_store.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.env.template b/.env.template index 45e075d67..b87db6f47 100644 --- a/.env.template +++ b/.env.template @@ -175,8 +175,9 @@ KNOWLEDGE_GRAPH_CHUNK_SEARCH_TOP_SIZE=5 # the top size of knowledge graph searc #VECTOR_STORE_TYPE=Milvus #MILVUS_URL=127.0.0.1 #MILVUS_PORT=19530 -#MILVUS_USERNAME -#MILVUS_PASSWORD +#MILVUS_USERNAME=dbgpt +#MILVUS_PASSWORD=aa12345678 +#MILVUS_DB_NAME=dbgpt #MILVUS_SECURE= ### Weaviate vector db config diff --git a/dbgpt/_private/config.py b/dbgpt/_private/config.py index 99eb0e2eb..7e01277b8 100644 --- a/dbgpt/_private/config.py +++ b/dbgpt/_private/config.py @@ -220,6 +220,7 @@ def __init__(self) -> None: self.MILVUS_PORT = os.getenv("MILVUS_PORT", "19530") self.MILVUS_USERNAME = os.getenv("MILVUS_USERNAME", None) self.MILVUS_PASSWORD = os.getenv("MILVUS_PASSWORD", None) + self.MILVUS_DB_NAME = os.getenv("MILVUS_DB_NAME", None) # Elasticsearch Vector Configuration self.ELASTICSEARCH_URL = os.getenv("ELASTICSEARCH_URL", "127.0.0.1") self.ELASTICSEARCH_PORT = os.getenv("ELASTICSEARCH_PORT", "9200") diff --git a/dbgpt/storage/vector_store/milvus_store.py b/dbgpt/storage/vector_store/milvus_store.py index 6b2d89f50..18c54c1ad 100644 --- a/dbgpt/storage/vector_store/milvus_store.py +++ b/dbgpt/storage/vector_store/milvus_store.py @@ -172,6 +172,7 @@ def __init__(self, vector_store_config: MilvusVectorConfig) -> None: "MILVUS_PASSWORD" ) self.secure = milvus_vector_config.get("secure") or os.getenv("MILVUS_SECURE") + self.db_name = milvus_vector_config.get("db_name") or os.getenv("MILVUS_DB_NAME") self.collection_name = ( milvus_vector_config.get("name") or vector_store_config.name @@ -228,6 +229,7 @@ def __init__(self, vector_store_config: MilvusVectorConfig) -> None: port=self.port or "19530", user=self.username, password=self.password, + db_name=self.db_name, alias="default", )