ai 使用
介绍自己 🙈
生成本文简介 👋
推荐相关文章 📖
前往主页 🏠
前往爱发电购买
这是写个我自看的 当然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
| <div> <div class="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" style="opacity: 1; transition-duration: 0.3s; transform: rotate(1080deg);"></i> <i class="anzhiyufont anzhiyu-icon-circle-dot" title="朗读摘要"></i> <div id="ai-tag">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;">介绍自己 🙈</div> <div class="ai-btn-item" style="display: block;">生成本文简介 👋</div> <div class="ai-btn-item" style="display: block;">推荐相关文章 📖</div> <div class="ai-btn-item" style="display: block;">前往主页 🏠</div> <div class="ai-btn-item" id="go-tianli-blog" style="display: none;">前往爱发电购买</div> </div> <script> typeWriter("ai正在总结中...") handleQianfanRequest(); function handleQianfanRequest() { const articleUrl = window.location.href; 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; typeWriter(text); }) } catch (error) { typeWriter("写的太玄幻了 ai总结不了...500"); } } function typeWriter(text) { const element = document.getElementById('typing-effect'); element.innerHTML = ""; let speed = 100; let i = 0; const 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!