minh-4T commited on
Commit
9a6304e
·
1 Parent(s): 0e72c10

change format answer

Browse files
Files changed (1) hide show
  1. core/qa_pipeline.py +3 -2
core/qa_pipeline.py CHANGED
@@ -241,8 +241,9 @@ def ask_ai_stream_delta(message: str, history: List, hybrid_retriever, cohort_ke
241
  yield "Chào bạn 👋 Mình hỗ trợ tra cứu quy chế đào tạo. Bạn cần hỏi điều gì?"
242
  return
243
 
244
- # [SKIP LLM] Nếu đây câu hỏi đầu tiên (history trống), bỏ qua LLM, chỉ trả về các tài liệu liên quan
245
- if not history or len(history) == 0:
 
246
  logger.info(f"[FIRST TURN] CÂU HỎI GỐC: {message}")
247
  question = message.strip()
248
  processed_data = analyze_and_expand_query(question)
 
241
  yield "Chào bạn 👋 Mình hỗ trợ tra cứu quy chế đào tạo. Bạn cần hỏi điều gì?"
242
  return
243
 
244
+ # Chế độ chỉ liệt tài liệu cho câu hỏi đầu tiên (mặc định: tắt)
245
+ first_turn_docs_only = os.getenv("FIRST_TURN_DOCS_ONLY", "false").strip().lower() in {"1", "true", "yes", "on"}
246
+ if first_turn_docs_only and (not history or len(history) == 0):
247
  logger.info(f"[FIRST TURN] CÂU HỎI GỐC: {message}")
248
  question = message.strip()
249
  processed_data = analyze_and_expand_query(question)