This commit is contained in:
hailin 2025-05-09 22:39:59 +08:00
parent 344e98a73c
commit 79c176c1d3
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ def build_user_index(user_id: str):
)
index_path = os.path.join(USER_INDEX_PATH, f"{user_id}.index")
faiss.write_index(vector_store.index, index_path) # ✅ 用传入的 vector_store
faiss.write_index(faiss_index, index_path) # ✅ 改这里,直接写 faiss_index
print(f"[BUILD] 为用户 {user_id} 构建并保存了索引 → {index_path}")
def query_user_rag(user_id: str, question: str, top_k: int = 4) -> str: