Spaces:
Sleeping
Sleeping
changed the intro message
Browse files- app/ingestion/rag_setup.py +12 -9
app/ingestion/rag_setup.py
CHANGED
|
@@ -211,20 +211,23 @@ STRICT RULES:
|
|
| 211 |
|
| 212 |
def build_welcome_message(ingest: ChatbotIngest) -> str:
|
| 213 |
"""
|
| 214 |
-
Build
|
| 215 |
"""
|
| 216 |
# Determine chatbot name
|
| 217 |
chatbot_name = ingest.chatbot_name or f"{ingest.company_name} Assistant"
|
| 218 |
|
| 219 |
# Filter out "capture leads (email, phone)" from purposes
|
| 220 |
-
purposes = [p for p in ingest.chatbot_purpose if p.lower() != "capture leads (email, phone)"]
|
| 221 |
-
|
| 222 |
-
#
|
| 223 |
-
intro_msg =
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
+ "\n".join(f"- {p}" for p in purposes
|
| 227 |
-
|
|
|
|
|
|
|
|
|
|
| 228 |
)
|
| 229 |
|
| 230 |
return intro_msg
|
|
|
|
| 211 |
|
| 212 |
def build_welcome_message(ingest: ChatbotIngest) -> str:
|
| 213 |
"""
|
| 214 |
+
Build a flexible and user-friendly welcome message for the chatbot using its ingest config.
|
| 215 |
"""
|
| 216 |
# Determine chatbot name
|
| 217 |
chatbot_name = ingest.chatbot_name or f"{ingest.company_name} Assistant"
|
| 218 |
|
| 219 |
# Filter out "capture leads (email, phone)" from purposes
|
| 220 |
+
purposes = [p for p in ingest.chatbot_purpose or [] if p.lower() != "capture leads (email, phone)"]
|
| 221 |
+
|
| 222 |
+
# Start message
|
| 223 |
+
intro_msg = f"Hello! 👋 I'm {chatbot_name}, your virtual assistant for {ingest.company_name}.\n"
|
| 224 |
+
|
| 225 |
+
if purposes:
|
| 226 |
+
intro_msg += "I can help you with:\n" + "\n".join(f"- {p}" for p in purposes) + "\n"
|
| 227 |
+
|
| 228 |
+
# Add flexible closing
|
| 229 |
+
intro_msg += (
|
| 230 |
+
"Just type your question below and I'll do my best to help!"
|
| 231 |
)
|
| 232 |
|
| 233 |
return intro_msg
|