jjmandog commited on
Commit
05bd80a
·
verified ·
1 Parent(s): 9e75562

The buttons don’t work I want to be able to train the AI and tell her what to say. Can you download each seat into the program so I couldlearn give me a way to teach it what to say - Follow Up Deployment

Browse files
Files changed (2) hide show
  1. index.html +83 -4
  2. prompts.txt +2 -1
index.html CHANGED
@@ -448,8 +448,8 @@
448
 
449
  <div class="mt-auto pt-4 border-t border-gray-200 dark:border-gray-700">
450
  <div class="flex gap-2">
451
- <input type="text" class="ios-input flex-1" placeholder="Teach your assistant...">
452
- <button class="w-12 h-12 rounded-xl bg-accent flex items-center justify-center text-white">
453
  <i class="fas fa-paper-plane"></i>
454
  </button>
455
  </div>
@@ -488,6 +488,16 @@
488
  </div>
489
 
490
  <script>
 
 
 
 
 
 
 
 
 
 
491
  // Screen navigation
492
  function showScreen(screenId) {
493
  document.querySelectorAll('.screen').forEach(screen => {
@@ -560,12 +570,81 @@
560
  });
561
  }
562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
563
  // Initialize when page loads
564
  document.addEventListener('DOMContentLoaded', () => {
565
  addAppearAnimations();
566
-
567
- // Random progress for AI learning
568
  simulateAIProgress();
 
 
 
 
 
 
 
 
 
 
 
569
  });
570
  </script>
571
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=jjmandog/jays" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
 
448
 
449
  <div class="mt-auto pt-4 border-t border-gray-200 dark:border-gray-700">
450
  <div class="flex gap-2">
451
+ <input id="trainingInput" type="text" class="ios-input flex-1" placeholder="Teach your assistant..." onkeypress="handleTrainingKeyPress(event)">
452
+ <button class="w-12 h-12 rounded-xl bg-accent flex items-center justify-center text-white" onclick="submitTraining()">
453
  <i class="fas fa-paper-plane"></i>
454
  </button>
455
  </div>
 
488
  </div>
489
 
490
  <script>
491
+ // AI Training Data
492
+ let trainingData = {
493
+ responses: [],
494
+ customResponses: {
495
+ business: '"Hello, this is [Your Name]\'s assistant. How can I help you today?"',
496
+ personal: '"Hi, this is [Name]\'s phone. I\'ll get your message to them."',
497
+ spam: '"Sorry, this number is not accepting unsolicited calls at this time."'
498
+ }
499
+ };
500
+
501
  // Screen navigation
502
  function showScreen(screenId) {
503
  document.querySelectorAll('.screen').forEach(screen => {
 
570
  });
571
  }
572
 
573
+ // Training Functions
574
+ function submitTraining() {
575
+ const input = document.getElementById('trainingInput');
576
+ if (input.value.trim() !== '') {
577
+ trainingData.responses.push(input.value);
578
+
579
+ // Add the user's message to the chat
580
+ const chatContainer = document.querySelector('#trainingScreen .flex-1.overflow-y-auto');
581
+ const userBubble = document.createElement('div');
582
+ userBubble.className = 'user-bubble mt-4 animate-fadeIn';
583
+ userBubble.innerHTML = `<p>${input.value}</p>`;
584
+ chatContainer.appendChild(userBubble);
585
+
586
+ // Generate and add AI response
587
+ setTimeout(() => {
588
+ const aiBubble = document.createElement('div');
589
+ aiBubble.className = 'ai-bubble mt-4 animate-fadeIn';
590
+ aiBubble.innerHTML = `
591
+ <p>Thank you for the feedback! I'll remember that.</p>
592
+ <p class="mt-2">Here's how I'll respond now:</p>
593
+ ${generateAIResponse(input.value.toLowerCase())}
594
+ `;
595
+ chatContainer.appendChild(aiBubble);
596
+ chatContainer.scrollTop = chatContainer.scrollHeight;
597
+ }, 800);
598
+
599
+ input.value = '';
600
+ }
601
+ }
602
+
603
+ function handleTrainingKeyPress(e) {
604
+ if (e.key === 'Enter') {
605
+ submitTraining();
606
+ }
607
+ }
608
+
609
+ function generateAIResponse(inputText) {
610
+ // Simple response generation logic
611
+ if (inputText.includes('business') || inputText.includes('work')) {
612
+ return `<div class="mt-2 bg-blue-50 dark:bg-blue-900 rounded-lg p-3">
613
+ <p>${trainingData.customResponses.business}</p>
614
+ </div>`;
615
+ }
616
+ else if (inputText.includes('personal') || inputText.includes('family')) {
617
+ return `<div class="mt-2 bg-blue-50 dark:bg-blue-900 rounded-lg p-3">
618
+ <p>${trainingData.customResponses.personal}</p>
619
+ </div>`;
620
+ }
621
+ else if (inputText.includes('spam') || inputText.includes('block')) {
622
+ return `<div class="mt-2 bg-blue-50 dark:bg-blue-900 rounded-lg p-3">
623
+ <p>${trainingData.customResponses.spam}</p>
624
+ </div>`;
625
+ }
626
+
627
+ // Default response
628
+ return `<div class="mt-2 bg-blue-50 dark:bg-blue-900 rounded-lg p-3">
629
+ <p>"I'll ask about the purpose of the call and take a message if needed."</p>
630
+ </div>`;
631
+ }
632
+
633
  // Initialize when page loads
634
  document.addEventListener('DOMContentLoaded', () => {
635
  addAppearAnimations();
 
 
636
  simulateAIProgress();
637
+
638
+ // Focus input when training screen opens
639
+ document.querySelectorAll('[onclick^="showScreen"]').forEach(btn => {
640
+ btn.addEventListener('click', function() {
641
+ if (this.getAttribute('onclick').includes('trainingScreen')) {
642
+ setTimeout(() => {
643
+ document.getElementById('trainingInput').focus();
644
+ }, 300);
645
+ }
646
+ });
647
+ });
648
  });
649
  </script>
650
  <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=jjmandog/jays" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
prompts.txt CHANGED
@@ -2,4 +2,5 @@ Create me a app that I can use and have it answer my phone calls with specified
2
  Create me a iOS app that I can use and have it answer my phone calls with specified things that I could have it say make it smart and learn.
3
  Make it editable and custom. Create me a iOS app that I can use and have it answer my phone calls with specified things that I could have it say make it smart and learn.
4
  Is this connected to my phone number?
5
- This to my phone number 562-228-9429
 
 
2
  Create me a iOS app that I can use and have it answer my phone calls with specified things that I could have it say make it smart and learn.
3
  Make it editable and custom. Create me a iOS app that I can use and have it answer my phone calls with specified things that I could have it say make it smart and learn.
4
  Is this connected to my phone number?
5
+ This to my phone number 562-228-9429
6
+ The buttons don’t work I want to be able to train the AI and tell her what to say. Can you download each seat into the program so I couldlearn give me a way to teach it what to say