This commit is contained in:
hailin 2025-05-10 00:25:27 +08:00
parent e5c83cd11d
commit 746b232514
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ def build_user_index(user_id: str):
logger.setLevel(logging.INFO)
logger.info(f"开始为用户 {user_id} 构建索引...")
# 确认文档目录是否存在
doc_dir = os.path.join(USER_DOC_PATH, user_id)
if not os.path.exists(doc_dir):
@ -58,7 +58,7 @@ def build_user_index(user_id: str):
faiss_index = faiss.IndexFlatL2(1024)
vector_store = FaissVectorStore(faiss_index=faiss_index)
# 确保索引保存路径存在
# 确保索引保存路径存在,使用用户 ID 区分索引文件
persist_dir = os.path.join(USER_INDEX_PATH, user_id)
logger.info(f"索引保存路径: {persist_dir}")