[opt] tianli_gpt

This commit is contained in:
xaoxuu 2024-02-18 12:31:36 +08:00
parent 88f16fc754
commit bb91a8d4ce
2 changed files with 22 additions and 27 deletions

View File

@ -453,12 +453,19 @@ plugins:
enable: #true
js: https://jsd.onmicrosoft.cn/gh/qxchuckle/Post-Summary-AI@6.0/chuckle-post-ai.min.js
field: post # all, post, wiki
api: 5Q5mpqRK5DkwT1X9Gi5e # tianli_gpt key
limit: 1000 # 设置提交的字数限制默认为1000字上限为5000超过5000字符将被截断
typingAnimate: true # 打字机动画
direct: true # 是否直接显示摘要,否则显示 AI 简介
recommend: all # all, web # 文章推荐方式all匹配数据库内所有文章进行推荐web仅当前站内的文章默认all
shuttle: true # 是否隐藏矩阵穿梭
key: 5Q5mpqRK5DkwT1X9Gi5e # tianli_gpt key
total_length: 1000 # 设置提交的字数限制默认为1000字上限为5000超过5000字符将被截断
typewriter: true # 打字机动画
summary_directly: true # 是否直接显示摘要,否则显示 AI 简介
rec_method: all # all, web # 文章推荐方式all匹配数据库内所有文章进行推荐web仅当前站内的文章默认all
hide_shuttle: true # 是否隐藏矩阵穿梭
summary_toggle: false
interface:
name: AI摘要
introduce: '我是文章辅助AI: QX-AI点击下方的按钮让我生成本文简介、推荐相关文章等。'
version: TianliGPT
button: ["介绍自己", "推荐文章", "生成摘要", "矩阵穿梭"]
# Katex - The fastest math typesetting library for the web
# https://katex.org/docs/autorender.html

View File

@ -1,23 +1,11 @@
<% if (['all', page.layout].includes(theme.plugins.tianli_gpt.field)) { %>
<script src="<%- theme.plugins.tianli_gpt?.js %>"></script>
<script data-pjax defer>
new ChucklePostAI({
<script defer src="<%- theme.plugins.tianli_gpt?.js %>"></script>
<script defer>
window.addEventListener('DOMContentLoaded', (event) => {
new ChucklePostAI(Object.assign({
el: 'article.content',
key: '<%= theme.plugins.tianli_gpt?.api %>',
rec_method: '<%= theme.plugins.tianli_gpt?.recommend || all %>',
summary_directly: `<%= theme.plugins.tianli_gpt?.direct %>`,
typewriter: `<%= theme.plugins.tianli_gpt?.typingAnimate %>`,
css: `/css/_plugins/tianli_gpt`,
summary_toggle: false,
total_length: `<%= theme.plugins.tianli_gpt?.limit %>`,
hide_shuttle: `<%= theme.plugins.tianli_gpt?.shuttle %>`,
interface: {
name: "AI摘要",
introduce: "我是文章辅助AI: QX-AI点击下方的按钮让我生成本文简介、推荐相关文章等。", // 自我介绍
version: "TianliGPT",
button: ["介绍自己", "推荐文章", "生成摘要", "矩阵穿梭"],
},
})
css: `/css/_plugins/tianli_gpt`
}, JSON.parse(`<%- JSON.stringify(theme.plugins.tianli_gpt) %>`)))
});
</script>
<% } %>