// Export all configuration and learning data // Business settings data let businessSettings = { maxRingTime: 30, smsResponseTime: 15, businessHours: { open: "08:00", close: "18:00" }, responses: { missedCall: "Hello, this is Jay's Mobile Wash. We missed your call. Please leave a message and we'll return your call as soon as possible.", afterHours: "Thank you for contacting Jay's Mobile Wash. Our business hours are [hours]. We will respond when we reopen." } }; function loadSettings() { const saved = localStorage.getItem('JMW_Settings'); if (saved) { businessSettings = JSON.parse(saved); document.getElementById('maxRingTime').value = businessSettings.maxRingTime; document.getElementById('smsResponseTime').value = businessSettings.smsResponseTime; document.getElementById('openTime').value = businessSettings.businessHours.open; document.getElementById('closeTime').value = businessSettings.businessHours.close; document.getElementById('missedCallResponse').value = businessSettings.responses.missedCall; document.getElementById('afterHoursResponse').value = businessSettings.responses.afterHours; } } function saveSettings() { businessSettings = { maxRingTime: parseInt(document.getElementById('maxRingTime').value), smsResponseTime: parseInt(document.getElementById('smsResponseTime').value), businessHours: { open: document.getElementById('openTime').value, close: document.getElementById('closeTime').value }, responses: { missedCall: document.getElementById('missedCallResponse').value, afterHours: document.getElementById('afterHoursResponse').value } }; localStorage.setItem('JMW_Settings', JSON.stringify(businessSettings)); // Show success message const notification = document.createElement('div'); notification.className = 'fixed top-40 left-1/2 transform -translate-x-1/2 bg-green-500 text-white px-6 py-3 rounded-xl animate-fadeIn z-50 shadow-lg'; notification.innerHTML = 'Settings saved successfully!'; document.body.appendChild(notification); setTimeout(() => notification.remove(), 3000); } // Enhanced answerCall with live training and call response function answerCall(isTestCall = false) { const currentTime = new Date(); const openTime = new Date(); const closeTime = new Date(); const [openHours, openMins] = businessSettings.businessHours.open.split(':'); const [closeHours, closeMins] = businessSettings.businessHours.close.split(':'); openTime.setHours(openHours, openMins); closeTime.setHours(closeHours, closeMins); const fab = document.querySelector('.fab'); const icon = fab.querySelector('i'); if (currentTime < openTime || currentTime > closeTime) { icon.classList.remove('fa-phone'); icon.classList.add('fa-clock'); showResponseMessage(businessSettings.responses.afterHours.replace('[hours]', `${businessSettings.businessHours.open} - ${businessSettings.businessHours.close}`)); setTimeout(() => { icon.classList.remove('fa-clock'); icon.classList.add('fa-phone'); }, 1000); return; } // Start call processing icon.classList.remove('fa-phone'); icon.classList.add('fa-headset'); // Create call interface const homeScreen = document.getElementById('homeScreen'); const callWindow = document.createElement('div'); callWindow.className = 'fixed inset-0 bg-black bg-opacity-70 z-50 flex flex-col items-center justify-center'; callWindow.innerHTML = `
(562) 228-9429
Train › Teach AI during call
AI will ask you questions during this call
AI that answers your calls and learns over time
Assistant is active
Answered 5 calls, 12 min talk time
Customize call responses
Improve AI responses
Incoming Call
(562) 228-9429
Missed Call
Unknown
AI Answered
Jay's Mobile Wash
Customize how AI answers calls
Improves responses over time
Set predefined responses
"Hello, this is [Your Name]'s assistant..."
"Hi, this is [Name]'s phone..."
"Sorry, this number is not accepting calls..."
Professional business language
Casual conversation style
"This is [Your Name]'s phone"
Linked to (562) 228-9429
How would you like me to respond to calls from your family?
Always transfer calls from Mom and Dad to me
Noted! I'll transfer calls from Mom and Dad immediately.
For other family members, how should I respond?
Ask them for the reason of calling and text me if it's important
Got it. Here's the response I created based on your feedback:
"Hello, this is Alex's assistant. Could you let me know what you're calling about? I'll make sure they get your message."
Does this work?
The AI learns from every interaction
Test and train the AI assistant
Hi! I'm your AI assistant for Jay's Mobile Wash. I can answer questions about our detailing services and learn from our conversations.
Would you like to test my knowledge or teach me something new?
I'll learn from every interaction
Configure AI response behavior
If you don't answer by this time, AI will answer
If you don't reply to SMS by this time
Enable AI to answer phone calls
Ask me questions during calls to learn