Spaces:
Sleeping
Sleeping
Upd lang guard
Browse files- api/chatbot.py +2 -2
api/chatbot.py
CHANGED
|
@@ -149,7 +149,7 @@ class RAGMedicalChatbot:
|
|
| 149 |
is_safe_ans, reason_ans = safety_guard.check_model_answer(user_query, response or "")
|
| 150 |
if not is_safe_ans:
|
| 151 |
logger.warning(f"[SAFETY] Withholding unsafe model answer: {reason_ans}")
|
| 152 |
-
response = "⚠️ I cannot share that information. Let's discuss this topic at a high level or try a different question."
|
| 153 |
|
| 154 |
# Store exchange + chunking
|
| 155 |
if user_id:
|
|
@@ -203,4 +203,4 @@ class RAGMedicalChatbot:
|
|
| 203 |
for citation_content in citations_found)
|
| 204 |
|
| 205 |
logger.info(f"[CITATION] Processed {total_citations} citations from {len(citations_found)} citation groups, {len(url_mapping)} URL mappings available")
|
| 206 |
-
return processed_response
|
|
|
|
| 149 |
is_safe_ans, reason_ans = safety_guard.check_model_answer(user_query, response or "")
|
| 150 |
if not is_safe_ans:
|
| 151 |
logger.warning(f"[SAFETY] Withholding unsafe model answer: {reason_ans}")
|
| 152 |
+
response = "⚠️ I cannot share that information. Let's discuss this topic at a high level or try a different question. Tips: Ensure correct language preferences."
|
| 153 |
|
| 154 |
# Store exchange + chunking
|
| 155 |
if user_id:
|
|
|
|
| 203 |
for citation_content in citations_found)
|
| 204 |
|
| 205 |
logger.info(f"[CITATION] Processed {total_citations} citations from {len(citations_found)} citation groups, {len(url_mapping)} URL mappings available")
|
| 206 |
+
return processed_response
|