bep40 commited on
Commit
7d759d1
·
verified ·
1 Parent(s): e54024e

Add chatbox local AI fallback and bump search cache

Browse files
Files changed (1) hide show
  1. index.html +8 -1
index.html CHANGED
@@ -1636,6 +1636,13 @@ return{p,score};
1636
  return scored.slice(0,8).map(x=>x.p);
1637
  }
1638
 
 
 
 
 
 
 
 
1639
  // Format products for context
1640
  function productsToContext(products){
1641
  return products.map(p=>{
@@ -2829,7 +2836,7 @@ Miễn phí giao hàng trong TPHCM. | Giá đã bao gồm VAT.
2829
  </div>
2830
  </div>
2831
  </div>
2832
- <script src="search-plus-boot.js?v=24"></script>
2833
  <script src="shorts-subtitles.js?v=2"></script>
2834
  <script src="ancuong-shorts.js?v=8"></script>
2835
  <script src="custom-shorts.js?v=4"></script>
 
1636
  return scored.slice(0,8).map(x=>x.p);
1637
  }
1638
 
1639
+
1640
+ function localAIFallbackAnswer(q){
1641
+ try{if(window._vaiTechnicalTextAnswer){let t=window._vaiTechnicalTextAnswer(q);if(t)return t;}}catch(e){}
1642
+ try{let ps=searchProducts(q);if(ps&&ps.length){return 'Em tìm được '+ps.length+' sản phẩm phù hợp theo dữ liệu hiện có. Anh/chị xem các thẻ sản phẩm bên dưới; nếu cần thông số cụ thể hãy nhắn mã SP hoặc tiêu chí kỹ thuật.';}}catch(e){}
1643
+ return 'Hiện hệ thống AI đang bận, nhưng em vẫn có thể tìm theo mã SP, tên sản phẩm hoặc tiêu chí như: combo bếp từ máy hút mùi dưới 15 triệu, kệ gia vị Grob 300mm.';
1644
+ }
1645
+
1646
  // Format products for context
1647
  function productsToContext(products){
1648
  return products.map(p=>{
 
2836
  </div>
2837
  </div>
2838
  </div>
2839
+ <script src="search-plus-boot.js?v=25"></script>
2840
  <script src="shorts-subtitles.js?v=2"></script>
2841
  <script src="ancuong-shorts.js?v=8"></script>
2842
  <script src="custom-shorts.js?v=4"></script>