Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -88,21 +88,27 @@ Aber ich kenne mich super aus mit:
|
|
88 |
- Anfahrt & Kontakt 📍
|
89 |
|
90 |
Frag mich einfach danach!"""
|
|
|
|
|
|
|
91 |
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
-
#
|
98 |
-
|
99 |
-
return f"Hey! Schau mal, wann Du bei uns vorbeikommen kannst:\n\n{answer}\n\nWir freuen uns auf Dich! 🎉"
|
100 |
-
elif 'hallenregeln' in category.lower():
|
101 |
-
return f"Hey! Damit alle Spaß haben und sicher springen können:\n\n{answer}\n\nDanke, dass Du die Regeln beachtest! 🙌"
|
102 |
-
elif 'kontakt' in category.lower():
|
103 |
-
return f"Cool, dass Du zu uns kommen möchtest!\n\n{answer}\n\nBis bald! 🚀"
|
104 |
-
else:
|
105 |
-
return answer
|
106 |
|
107 |
def chat(message, history):
|
108 |
"""Main chat function"""
|
|
|
88 |
- Anfahrt & Kontakt 📍
|
89 |
|
90 |
Frag mich einfach danach!"""
|
91 |
+
|
92 |
+
# Kategorien prüfen
|
93 |
+
query_text = results[0].page_content.lower()
|
94 |
|
95 |
+
# Adress-/Kontaktanfragen
|
96 |
+
if 'kontakt' in query_text or 'wo finde' in query_text or 'adresse' in query_text:
|
97 |
+
for result in results:
|
98 |
+
if 'contact' in result.metadata.get('source', ''):
|
99 |
+
return f"Cool, dass Du zu uns kommen möchtest! Hier findest Du uns:\n\n{result.page_content}\n\nBis bald! 🚀"
|
100 |
+
|
101 |
+
# Geburtstagsfragen
|
102 |
+
if 'geburtstag' in query_text or 'feiern' in query_text:
|
103 |
+
birthday_info = []
|
104 |
+
for result in results:
|
105 |
+
if 'geburtstagsinfos' in result.metadata.get('source', '').lower():
|
106 |
+
birthday_info.append(result.page_content)
|
107 |
+
if birthday_info:
|
108 |
+
return "Hier sind alle wichtigen Infos zu Kindergeburtstagen:\n\n• " + "\n\n• ".join(birthday_info)
|
109 |
|
110 |
+
# Standardantwort mit dem besten Match
|
111 |
+
return results[0].page_content
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
def chat(message, history):
|
114 |
"""Main chat function"""
|