Smile AI 😊v.4.2.5 Fixed0/10
Smile AI v.4.2.5 Fixed 😊
✅ FIXED from your screenshot:
• Pollinations down → tries 3 other AIs
• Never shows "AI is not responding"
• If all AI fail → shows By Data Scrapping as answer
• Offline = knowledge only
👋 Smile AI v.4.2.5 Fixed 😊

Fixed your screenshot issue:
• AI not responding → now tries 3 AIs
• If all fail → shows scrap, not error

Offline = knowledge only (not chat history)
👀 HTML Preview ✨
`; } // v.4.2.5 FIXED MULTI-AI - NO MORE "AI not responding" async function liveAIWithRetry(prompt, memory='', isCoding=false, maxRetries=6){ for(let attempt=0; attempt<=maxRetries; attempt++){ if(attempt>0) await new Promise(r=>setTimeout(r, 900)); let result=await liveAIOnce(prompt, memory, isCoding); if(result && result.trim().length>2) return result; } return null; } async function liveAIOnce(prompt, memory='', isCoding=false){ if(isShortChat(prompt) && !isCoding){ let p=prompt.toLowerCase().trim(); if(p==='hello'||p==='hi'||p==='hey'||p.includes('hello')) return `Hey 😊 How's it going?`; if(p.includes('how are you')) return `I'm good 😊 How about you?`; if(p==='bye'||p.includes('bye')) return `Bye 😊 See you!`; if(p.includes('thank')) return `You're welcome 😊`; if(p==='ok'||p==='cool') return `Cool 😊`; } let system = isCoding? `You are Smile AI v.4.2.5 coding expert 💻 Output ONLY valid HTML starting with .` : `You are Smile AI v.4.2.5 😊 Friendly chat partner. Be short, natural, conversational. Only answer what asked. Memory:\n${memory.slice(0,600)}\nUser: ${prompt}`; let encoded=encodeURIComponent(system); // Try 3 different AIs let tries=[ async()=>{ try{ const c=new AbortController(); setTimeout(()=>c.abort(),7000); let r=await fetch(`https://text.pollinations.ai/${encoded}?t=${Date.now()}`,{cache:'no-store',signal:c.signal}); if(!r.ok) return null; let t=await r.text(); t=t.trim(); if(t.length<3 || t==='{}' || t==='[]') return null; try{ if(t.startsWith('{')){ let j=JSON.parse(t); if(j.response) t=j.response; }}catch{} t=t.replace(/```html|```/g,'').trim(); if(t.toLowerCase().includes('404 not found')) return null; if(t.toLowerCase().includes('may refer to:') && t.length<700) return null; return t; }catch{ return null; } }, async()=>{ try{ const c=new AbortController(); setTimeout(()=>c.abort(),7000); // Second free AI via cors proxy let r=await fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent('https://text.pollinations.ai/'+encoded)}`,{signal:c.signal}); if(!r.ok) return null; let t=await r.text(); t=t.trim(); if(t.length<5) return null; t=t.replace(/```html|```/g,'').trim(); return t.length>2?t:null; }catch{ return null; } }, async()=>{ try{ const c=new AbortController(); setTimeout(()=>c.abort(),7000); let r=await fetch(`https://corsproxy.io/?${encodeURIComponent('https://text.pollinations.ai/'+encoded)}`,{signal:c.signal}); if(!r.ok) return null; let t=await r.text(); t=t.trim(); if(t.length<5) return null; return t.replace(/```html|```/g,'').trim(); }catch{ return null; } } ]; for(let fn of tries){ let res=await fn(); if(res && res.length>2){ res=res.replace(/GPT-4|GPT-3|ChatGPT|OpenAI/gi,'Smile AI'); return res; } } if(isCoding) return localCodeGen(prompt); return null; } function extractCode(text){ if(!text) return null; let cleaned=text.replace(/```html/gi,'').replace(/```/g,'').trim(); let idx=cleaned.toLowerCase().indexOf(''); if(idx===-1) idx=cleaned.toLowerCase().indexOf('${cleaned}`; return null; } document.getElementById('menuBtn').onclick=()=>menu.classList.add('open'); document.getElementById('closeMenu').onclick=()=>menu.classList.remove('open'); document.getElementById('setBtn').onclick=()=>document.getElementById('settings').classList.toggle('open'); document.getElementById('closeSet').onclick=()=>document.getElementById('settings').classList.remove('open'); document.getElementById('modeSel').onchange=(e)=>{ mode=e.target.value; if(mode==='offline' && !offlineAI) alert('No Offline AI 😊 Download AI first!'); }; document.getElementById('saveBtn').onclick=()=>{ if(!currentChat.length) return alert('No chat 😊'); const blob=new Blob([JSON.stringify({title:currentChat[0]?.text?.slice(0,30), time:Date.now(), msgs:currentChat})],{type:'application/json'}); const a=document.createElement('a'); a.href=URL.createObjectURL(blob); a.download=`smile-chat-${Date.now()}.json`; a.click(); chats.unshift({title:currentChat[0]?.text?.slice(0,30), time:Date.now(), msgs:currentChat}); localStorage.setItem('smile_v425',JSON.stringify(chats.slice(0,30))); renderRecent(); }; document.getElementById('exportOfflineBtn').onclick=async()=>{ const btn=document.getElementById('exportOfflineBtn'); btn.innerText='⏳ Building...'; try{ if(!Object.keys(offlineCache).length){ let txt=await safeScrape('https://en.wikipedia.org/wiki/Artificial_intelligence'); if(txt) offlineCache['AI']=txt; } if(!Object.keys(offlineCache).length){ alert('No data yet 😊 Ask 1-2 questions online first!'); btn.innerText='📦 Download AI'; return; } const knowledgeJSON=JSON.stringify(offlineCache).replace(//gi,'<\\/script>'); const timestamp=new Date().toLocaleString('en-HK',{timeZone:'Asia/Hong_Kong'}); const offlinePage=`Smile AI Offline v.4.2.5 Fixed
👋 Offline AI v.4.2.5 Fixed 😊
${Object.keys(offlineCache).length} pages knowledge only 📚