HaRin2806 commited on
Commit
fdadbea
·
1 Parent(s): dce238e

return 5 chunks

Browse files
Files changed (1) hide show
  1. core/rag_pipeline.py +2 -2
core/rag_pipeline.py CHANGED
@@ -40,7 +40,7 @@ class RAGPipeline:
40
  # SỬA: Chỉ search trong ChromaDB, không load lại dữ liệu
41
  logger.info("Đang tìm kiếm thông tin liên quan...")
42
  search_results = self.embedding_model.search(query, top_k=TOP_K_RESULTS)
43
-
44
  if not search_results or len(search_results) == 0:
45
  logger.warning("Không tìm thấy thông tin liên quan")
46
  return {
@@ -107,7 +107,7 @@ class RAGPipeline:
107
  return {
108
  "success": True,
109
  "response": response_text,
110
- "sources": sources[:3] # Giới hạn 3 sources để không quá dài
111
  }
112
 
113
  except Exception as e:
 
40
  # SỬA: Chỉ search trong ChromaDB, không load lại dữ liệu
41
  logger.info("Đang tìm kiếm thông tin liên quan...")
42
  search_results = self.embedding_model.search(query, top_k=TOP_K_RESULTS)
43
+ z
44
  if not search_results or len(search_results) == 0:
45
  logger.warning("Không tìm thấy thông tin liên quan")
46
  return {
 
107
  return {
108
  "success": True,
109
  "response": response_text,
110
+ "sources": sources
111
  }
112
 
113
  except Exception as e: