faq-trigger: auch in /api/chat (Website-Chat) einbauen
This commit is contained in:
@@ -3573,6 +3573,21 @@ def api_chat():
|
|||||||
if not user_message:
|
if not user_message:
|
||||||
return jsonify({'reply': 'Leere Nachricht. Was möchtest du wissen?'})
|
return jsonify({'reply': 'Leere Nachricht. Was möchtest du wissen?'})
|
||||||
|
|
||||||
|
# ── FAQ-Trigger: "Keine Antwort" / "Warum keine Nachricht" ──────
|
||||||
|
faq_keywords = [
|
||||||
|
"keine antwort", "bekomme keine", "keine nachricht",
|
||||||
|
"antwort kommt nicht", "warum keine", "keine rückmeldung",
|
||||||
|
"why no reply", "not receiving", "save contact", "nummer speichern"
|
||||||
|
]
|
||||||
|
if any(kw in user_message.lower() for kw in faq_keywords):
|
||||||
|
return jsonify({'reply': (
|
||||||
|
"💡 *Tipp:* Damit unsere Antworten bei dir ankommen, "
|
||||||
|
"speichere bitte unsere Nummer in deinem Adressbuch. "
|
||||||
|
"WhatsApp filtert Nachrichten von unbekannten Business-Accounts "
|
||||||
|
"auf manchen Handys leider automatisch heraus.\n\n"
|
||||||
|
"Sobald du uns als Kontakt gespeichert hast, klappt's! ✅"
|
||||||
|
)})
|
||||||
|
|
||||||
# Build context from published submissions
|
# Build context from published submissions
|
||||||
rows = db.execute(
|
rows = db.execute(
|
||||||
"SELECT id, halle, content, summary, type, sender_name, category, "
|
"SELECT id, halle, content, summary, type, sender_name, category, "
|
||||||
|
|||||||
Reference in New Issue
Block a user