Spaces:
Runtime error
Runtime error
change format answer
Browse files- 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 |
-
#
|
| 245 |
-
|
|
|
|
| 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 kê 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)
|