Skip to content

Commit c798c5d

Browse files
fix test rag
1 parent 20193ba commit c798c5d

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

app/services/rag_engine.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,25 @@ def search(self, query: str, threshold: float = 0.45) -> Dict:
9696
q_lower = clean_query.lower()
9797

9898
# Réponses statiques
99-
if q_lower in {"bonjour", "hello", "salut", "hi", "bonsoir", "coucou"}:
99+
greetings = {"bonjour", "hello", "salut", "hi", "bonsoir", "coucou"}
100+
thanks = {"merci", "thanks", "gratitude"}
101+
102+
if q_lower in greetings:
100103
return {
101104
"answer": "Bonjour ! Comment puis-je vous aider ?",
102105
"confidence": 1.0,
103106
"provider": "static_rule",
104107
"matched_question": None,
105108
}
106109

110+
if any(t in q_lower for t in thanks):
111+
return {
112+
"answer": "Je vous en prie ! N'hésitez pas si vous avez d'autres questions.",
113+
"confidence": 1.0,
114+
"provider": "static_rule",
115+
"matched_question": None,
116+
}
117+
107118
if len(clean_query) < 5:
108119
return {
109120
"answer": "Pouvez-vous préciser votre question ?",

0 commit comments

Comments
 (0)