ai 使用
介绍自己 🙈
生成本文简介 👋
推荐相关文章 📖
前往主页 🏠
前往爱发电购买
自建iframe
这是写个我自看的 当然hexo博客框架也能用
AI总结整体代码markdown中使用 中间不能有换行!中间不能有换行!中间不能有换行!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
| <div> <div class="post-ai-description" id="post-ai-description"> <div class="ai-title"> <i class="anzhiyufont anzhiyu-icon-bilibili"></i> <div class="ai-title-text">AI-摘要</div> <i class="anzhiyufont anzhiyu-icon-arrow-rotate-right" id="arrow-rotate-right" onclick="againBlurb()"></i> <i class="anzhiyufont anzhiyu-icon-circle-dot" title="朗读摘要"></i> <div id="ai-tag" onclick="introHer()">ZERONE GPT</div> </div> <div class="ai-explanation" id="typing-effect"></div> <div class="ai-btn-box"><div class="ai-btn-item" style="display: block;" onclick="introHer()">介绍自己 🙈</div> <div class="ai-btn-item" style="display: block;" onclick="createBlurb()">生成本文简介 👋</div> <div class="ai-btn-item" style="display: block;">推荐相关文章 📖</div> <div class="ai-btn-item" style="display: block;" onclick="goHome()">前往主页 🏠</div> <div class="ai-btn-item" id="go-tianli-blog" style="display: none;">前往爱发电购买</div> </div> <script> let interval; let isClick = true; let rotateNum = 0; typeWriter("ai正在总结中...") handleQianfanRequest(); function handleQianfanRequest() { const articleUrl = "https://vvan.581801.xyz/2025/07/28/css-test/"; const qianfanUrl = 'https://qianfan.baidubce.com/v2/chat/completions' const authToken = 'token值' try { const enhancedBody = { "model": "ernie-4.0-turbo-8k", "stream_options":{ "include_usage":false }, "messages": [{ "role": "user", "content":"简短总结文章内容" }], "plugins": [ "ChatFilePlus" ], "stream": false, "plugin_options": { "plugin_args": { "ChatFilePlus": { "body": { "files": [ [ { "type": "link", "url": articleUrl , "name": articleUrl } ] ] } } } } } const responseData = fetch(qianfanUrl, { method: 'POST', headers: { 'Content-Type': 'application/json', 'appid': 'app-3U8nY0Ca', 'Authorization': 'Bearer ' + authToken }, body: JSON.stringify(enhancedBody) }).then(response => response.json()) .then(data => { const text = data.choices[0].message.content; isClick = true; typeWriter(text); }) } catch (error) { typeWriter("写的太玄幻了 ai总结不了...500"); } } function introHer() { const text = "你好,我是ZERONE GPT,一个基于AI的智能助手。我可以帮助你生成文章简介、推荐相关文章,或者直接前往我的主页。请问有什么我可以帮助你的吗?"; typeWriter(text); } function createBlurb() { if (isClick) { isClick = false; typeWriter("请稍等,正在生成本文简介..."); handleQianfanRequest(); } } function againBlurb() { if (isClick) { isClick = false; rotateNum++; const rotateRight = document.getElementById('arrow-rotate-right'); rotateRight.style.opacity = "1"; rotateRight.style.transitionDuration = "1s"; rotateRight.style.transform = "rotate(" + 360 * rotateNum + "deg)"; typeWriter("请稍等,正在重新生成简介..."); handleQianfanRequest(); } } function goHome() { typeWriter("正在前往博客主页..."); setTimeout(() => { window.location.href = "/"; }, 1000); } function typeWriter(text) { clearInterval(interval); const element = document.getElementById('typing-effect'); element.innerHTML = ""; let speed = 100; let i = 0; interval = setInterval(() => { if (i < text.length) { element.innerHTML += text.charAt(i); i++; element.scrollTop = element.scrollHeight; } else { clearInterval(interval); } }, speed); } </script> </div>
|


ZERONE
没事就写写!
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 ZERONE Blog!