change to milvus standlone

This commit is contained in:
gameloader
2025-04-17 11:26:17 +08:00
parent b5c417f974
commit 45470fd13d
2 changed files with 3 additions and 1 deletions

View File

@ -41,6 +41,7 @@ USER_ID_PREFIX = "user"
MILVUS_PERSIST_BASE_DIR = Path("./milvus_user_data_openai")
MILVUS_INDEX_PARAMS = {"index_type": "FLAT", "metric_type": "L2", "params": {}}
MILVUS_SEARCH_PARAMS = {"metric_type": "L2", "params": {}}
MILVUS_STAND_URI = "http://localhost:19530"
# --- RAG Pipeline Configuration (保持不变) ---
RETRIEVER_TOP_K = 3

View File

@ -14,6 +14,7 @@ from config import (
MILVUS_PERSIST_BASE_DIR,
MILVUS_INDEX_PARAMS,
MILVUS_SEARCH_PARAMS,
MILVUS_STAND_URI,
)
logger = logging.getLogger(__name__) # Use logger
@ -38,7 +39,7 @@ def initialize_milvus_lite(user_id: str) -> MilvusDocumentStore:
print(f"Expecting Embedding Dimension (for first write): {OPENAI_EMBEDDING_DIM}")
document_store = MilvusDocumentStore(
connection_args={"uri": milvus_uri},
connection_args={"uri": MILVUS_STAND_URI},
collection_name=user_id, # Default or customize
index_params=MILVUS_INDEX_PARAMS, # Pass index config
search_params=MILVUS_SEARCH_PARAMS, # Pass search config