Spaces:
Running
Running
Polish UI copy and assistant tone to industry-standard concierge voice
Browse files- chat.js +8 -8
- index.html +8 -7
- lead-config.json +2 -2
chat.js
CHANGED
|
@@ -114,8 +114,8 @@ const M2 = (container = mainChatMessages) => {
|
|
| 114 |
});
|
| 115 |
|
| 116 |
if (res.ok) {
|
| 117 |
-
if (status) status.textContent = 'Lead
|
| 118 |
-
appendMessage('Thanks —
|
| 119 |
setTimeout(() => {
|
| 120 |
const f = document.getElementById('lead-form');
|
| 121 |
if (f) f.parentElement.remove();
|
|
@@ -180,13 +180,13 @@ const M4 = (messageText, container = mainChatMessages, sender = 'ai', streaming
|
|
| 180 |
}
|
| 181 |
};
|
| 182 |
|
| 183 |
-
// M5: Fallback response generator
|
| 184 |
const M5 = (text) => {
|
| 185 |
const lowerText = (text || '').toLowerCase();
|
| 186 |
if (lowerText.includes('buy') || lowerText.includes('sell') || lowerText.includes('consult') || lowerText.includes('schedule') || lowerText.includes('book')) {
|
| 187 |
-
return `I can help
|
| 188 |
}
|
| 189 |
-
return '
|
| 190 |
};
|
| 191 |
|
| 192 |
// Pipeline: compose M1..M4
|
|
@@ -244,9 +244,9 @@ M1().then(() => {
|
|
| 244 |
});
|
| 245 |
});
|
| 246 |
|
| 247 |
-
// Welcome message
|
| 248 |
-
M4(`Hello
|
| 249 |
-
if (chatMessages) M4('
|
| 250 |
});
|
| 251 |
|
| 252 |
// Expose pipeline and M2 externally
|
|
|
|
| 114 |
});
|
| 115 |
|
| 116 |
if (res.ok) {
|
| 117 |
+
if (status) status.textContent = 'Lead submitted — thank you. A member of our team will be in touch shortly.';
|
| 118 |
+
appendMessage('Thanks — your details have been sent to our team. We will reach out to schedule next steps.', 'ai', container);
|
| 119 |
setTimeout(() => {
|
| 120 |
const f = document.getElementById('lead-form');
|
| 121 |
if (f) f.parentElement.remove();
|
|
|
|
| 180 |
}
|
| 181 |
};
|
| 182 |
|
| 183 |
+
// M5: Fallback response generator (concierge tone)
|
| 184 |
const M5 = (text) => {
|
| 185 |
const lowerText = (text || '').toLowerCase();
|
| 186 |
if (lowerText.includes('buy') || lowerText.includes('sell') || lowerText.includes('consult') || lowerText.includes('schedule') || lowerText.includes('book')) {
|
| 187 |
+
return `I can help with that. Would you like me to collect a few details so our team (${x2?.business?.phoneDisplay || ''}) can follow up and assist you directly?`;
|
| 188 |
}
|
| 189 |
+
return 'I can help with listings, valuations, or booking a showing. Would you like to complete a short form so we can get started?';
|
| 190 |
};
|
| 191 |
|
| 192 |
// Pipeline: compose M1..M4
|
|
|
|
| 244 |
});
|
| 245 |
});
|
| 246 |
|
| 247 |
+
// Welcome message (concierge tone)
|
| 248 |
+
M4(`Hello — I'm ${x2?.chat?.assistantName || 'Assistant'}. How can I help you with your real estate needs today?`, mainChatMessages, 'ai', true);
|
| 249 |
+
if (chatMessages) M4('Quick options: find homes, sell my home, request a valuation, or book a showing.', chatMessages, 'ai', true);
|
| 250 |
});
|
| 251 |
|
| 252 |
// Expose pipeline and M2 externally
|
index.html
CHANGED
|
@@ -187,9 +187,10 @@
|
|
| 187 |
<div class="search-bar p-6 rounded-2xl max-w-3xl mx-auto mb-8 animate-slide-up">
|
| 188 |
<div class="max-w-3xl mx-auto">
|
| 189 |
<div class="mb-4 text-left">
|
| 190 |
-
<h3 class="text-2xl font-extrabold text-exit-dark">
|
| 191 |
-
<p class="text-sm text-gray-200">
|
| 192 |
-
|
|
|
|
| 193 |
</div>
|
| 194 |
|
| 195 |
<div id="main-chat-messages" role="log" aria-live="polite"
|
|
@@ -198,13 +199,13 @@
|
|
| 198 |
|
| 199 |
<div class="flex flex-wrap gap-2 mb-3">
|
| 200 |
<button class="quick-reply px-3 py-1 rounded-full bg-exit-blue text-white text-sm"
|
| 201 |
-
data-text="I'm
|
| 202 |
<button class="quick-reply px-3 py-1 rounded-full bg-exit-green text-white text-sm"
|
| 203 |
-
data-text="I'm
|
| 204 |
<button class="quick-reply px-3 py-1 rounded-full bg-white text-exit-blue text-sm border"
|
| 205 |
-
data-text="What's my home worth?">
|
| 206 |
<button class="quick-reply px-3 py-1 rounded-full bg-white text-exit-blue text-sm border"
|
| 207 |
-
data-text="Schedule a showing">
|
| 208 |
</div>
|
| 209 |
|
| 210 |
<div class="flex gap-3">
|
|
|
|
| 187 |
<div class="search-bar p-6 rounded-2xl max-w-3xl mx-auto mb-8 animate-slide-up">
|
| 188 |
<div class="max-w-3xl mx-auto">
|
| 189 |
<div class="mb-4 text-left">
|
| 190 |
+
<h3 class="text-2xl font-extrabold text-exit-dark">Talk with our Property Concierge</h3>
|
| 191 |
+
<p class="text-sm text-gray-200">Get local expertise — inquire about buying, selling, home
|
| 192 |
+
valuations, or book a showing. We'll collect the details and connect you with an agent.
|
| 193 |
+
</p>
|
| 194 |
</div>
|
| 195 |
|
| 196 |
<div id="main-chat-messages" role="log" aria-live="polite"
|
|
|
|
| 199 |
|
| 200 |
<div class="flex flex-wrap gap-2 mb-3">
|
| 201 |
<button class="quick-reply px-3 py-1 rounded-full bg-exit-blue text-white text-sm"
|
| 202 |
+
data-text="I'm ready to buy">Find homes</button>
|
| 203 |
<button class="quick-reply px-3 py-1 rounded-full bg-exit-green text-white text-sm"
|
| 204 |
+
data-text="I'm ready to sell">Sell my home</button>
|
| 205 |
<button class="quick-reply px-3 py-1 rounded-full bg-white text-exit-blue text-sm border"
|
| 206 |
+
data-text="What's my home worth?">Get valuation</button>
|
| 207 |
<button class="quick-reply px-3 py-1 rounded-full bg-white text-exit-blue text-sm border"
|
| 208 |
+
data-text="Schedule a showing">Book a showing</button>
|
| 209 |
</div>
|
| 210 |
|
| 211 |
<div class="flex gap-3">
|
lead-config.json
CHANGED
|
@@ -16,8 +16,8 @@
|
|
| 16 |
"formsubmitEndpoint": "https://formsubmit.co/ajax/info@exitcw.com"
|
| 17 |
},
|
| 18 |
"chat": {
|
| 19 |
-
"assistantName": "EXIT Realty CW
|
| 20 |
-
"prompt": "You are
|
| 21 |
"intents": [
|
| 22 |
"consult",
|
| 23 |
"schedule",
|
|
|
|
| 16 |
"formsubmitEndpoint": "https://formsubmit.co/ajax/info@exitcw.com"
|
| 17 |
},
|
| 18 |
"chat": {
|
| 19 |
+
"assistantName": "EXIT Realty CW Concierge",
|
| 20 |
+
"prompt": "You are the EXIT REALTY CW Concierge — a professional real estate assistant for Plover, WI. Your role is to provide concise, locally-informed answers and to qualify leads when appropriate by collecting: full name, email, phone, intent (buy/sell/rent), location/address, price range, and timeline. Ask one clear question at a time, offer concrete next steps (book a showing, request a valuation, or connect with an agent), and present the inline lead form when the visitor is ready. Keep a professional, helpful tone; never provide legal or financial advice.",
|
| 21 |
"intents": [
|
| 22 |
"consult",
|
| 23 |
"schedule",
|