Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🥵🥵🥵 #496

Merged
merged 131 commits into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
1238bdf
feat: add support for ‘greeting’ and ‘global reply mode’ commands, im…
Apr 8, 2023
c1d1e41
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
Apr 11, 2023
928ea45
feat: Add support for black and white lists, global reply mode and vo…
Apr 11, 2023
873f9ee
feat: 为新功能完善了帮助面板
Apr 12, 2023
ffcf3a3
docs: 完善了‘打招呼’的帮助说明
Apr 12, 2023
4dcf512
Merge remote-tracking branch 'origin/v2' into v2
Apr 14, 2023
f6805cb
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
Apr 15, 2023
4e163d9
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
Apr 16, 2023
d2ed3f4
Commit Type: feat, bugfix
Apr 17, 2023
94476c8
Commit Type: feat, bugfix
Apr 17, 2023
9ec8816
Merge remote-tracking branch 'sean/v2' into v2
Apr 17, 2023
fe76b49
refactor: Remove redundant log output.
Qz-Sean Apr 17, 2023
8c65493
Merge remote-tracking branch 'origin/v2' into v2
Apr 17, 2023
baea786
Merge remote-tracking branch 'sean/v2' into v2
Apr 17, 2023
c47dfa2
Refactor: optimize code logic
Apr 17, 2023
da7e607
Merge branch 'v2' into v2
ikechan8370 Apr 17, 2023
704098d
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 17, 2023
a1678f2
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
Apr 17, 2023
d2e0d05
Fix: 修复绘图指令表被抢指令的bug。
Apr 17, 2023
d6b2a3c
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 17, 2023
a34c6df
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 17, 2023
0d1d461
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 18, 2023
179aef2
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 20, 2023
0ee4ea9
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 20, 2023
a1af011
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 21, 2023
4d2a2ef
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 22, 2023
bf6b7ef
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 24, 2023
8f05c75
Refactor:1. Add support for automatically translating replies to Japa…
Apr 25, 2023
ddc43db
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Apr 25, 2023
bbfd69a
Merge remote-tracking branch 'origin/v2' into v2
Apr 25, 2023
628fc30
Refactor:Handle the issue of exceeding character setting limit caused…
Apr 25, 2023
c09914f
Fix: fix bugs
Apr 25, 2023
86aaaaa
Refactor: Added error feedback to translation service
Apr 26, 2023
f07b2b0
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
May 3, 2023
87f8d9b
Refactor: Added support for viewing the list of supported roles for e…
May 3, 2023
58aca55
Refactor: Optimized some command feedback and added owner restriction…
May 4, 2023
ceb7b8d
Refactor: Optimized feedback when viewing role list to avoid excessiv…
May 4, 2023
67cbe2d
Refactor: Optimized feedback when configuring multi-emotion mode.
May 4, 2023
a2a57f4
Feature: Added help instructions for translation feature.
May 4, 2023
d70d87c
chore: Adjust help instructions for mood settings
May 4, 2023
b5d4c36
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 4, 2023
4929bfc
Fix: Fixed issue where only first line of multi-line replies were bei…
May 4, 2023
9509def
Fix: Fixed bug where switching to Azure voice mode prompted for missi…
May 4, 2023
b130be1
Refactor: Add image OCR function and support translation for both quo…
May 5, 2023
0f7fcac
fix: Fix issue with error caused by non-image input.
May 5, 2023
49849cb
Refactor: Optimize code to filter emojis that cannot be displayed pro…
May 5, 2023
36c9e9a
Refactor: Optimize some code structures.
May 5, 2023
7c91e36
fix: Fix the bug of returning only one result when entering multiple …
May 5, 2023
5b49b3f
Refactor: Optimize code logic for better user experience
May 5, 2023
fd3ad01
Refactor: Fix the conflict issue with other plugin translation commands
May 5, 2023
c668d9f
Refactor: Replace Baidu Translation with Youdao Translation to elimin…
May 6, 2023
25f5d8a
Merge remote-tracking branch 'ikechan8370/v2' into v2
May 6, 2023
411251a
Refactor: Remove unused files and dependencies in the project.
May 6, 2023
3e60f93
Feature: Add Youdao translation service to provide more comprehensive…
May 6, 2023
84b45d5
Refactor: Optimize translation experience
May 6, 2023
62a2a0e
Refactor: Optimize translation experience
May 6, 2023
aeb6f2e
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 7, 2023
0d372e5
Feature: Add functionality of keyword search command
May 10, 2023
f6fd238
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 11, 2023
0be8dcd
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
May 18, 2023
7ac5bcc
Feature: Add functionality of keyword search command.
May 18, 2023
748104b
Refactor: Remove redundant code
May 18, 2023
0109510
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 19, 2023
98df7d3
Add: Add feature to support randomly selecting roles for Azure voice.…
May 19, 2023
9694fc6
Refactor: Remove redundant code
May 19, 2023
7e7dda1
Merge branch 'v2' of https://github.com/Qz-Sean/chatgpt-plugin into v2
May 19, 2023
5e535db
Refactor: Improve the function of setting global voice roles and view…
May 19, 2023
315b1ba
Refactor: Remove redundant code
May 19, 2023
788b5eb
Feature: Add new function to support random character dialogues in al…
May 20, 2023
4a3f540
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 21, 2023
97d7257
Refactor: Add compatibility directive for viewing reply settings feature
May 21, 2023
0b0e023
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 21, 2023
a40a7da
Merge branch 'v2' of https://github.com/Qz-Sean/chatgpt-plugin into v2
May 21, 2023
222763c
Feature: support adding QQ number to blacklist/whitelist
May 22, 2023
430ae34
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 23, 2023
54855ab
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 25, 2023
9f6bd7c
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 25, 2023
238fb85
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 26, 2023
db28be9
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 29, 2023
f6929e6
fix: 处理全局设置指令被上下班指令占用的问题
May 30, 2023
b28bf8b
fix: 处理全局设置指令被上下班指令占用的问题
May 30, 2023
1768b80
Merge branch 'ikechan8370:v2' into v2
Qz-Sean May 31, 2023
42239fd
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
Qz-Sean Jun 9, 2023
4f7f480
Refactor: Preprocess dialogue blacklist/whitelist when filling in the…
Qz-Sean Jun 9, 2023
0dd2458
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Jun 12, 2023
b92afde
Fix: Fixed the issue where black and white lists were not effective w…
Qz-Sean Jun 12, 2023
1f40e66
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Jun 16, 2023
4e7c04a
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Jun 19, 2023
4a4dcee
fix: 2.7 dev start
ikechan8370 Jun 22, 2023
97b3acb
feat: 初步支持function call(WIP)
ikechan8370 Jun 22, 2023
49548e2
fix: syntax error
ikechan8370 Jun 22, 2023
7b6357e
fix: syntax error
ikechan8370 Jun 22, 2023
cf7b9b7
feat: 群聊上下文
ikechan8370 Jun 22, 2023
188dcbc
fix: 暂时阉割掉全员禁言功能
ikechan8370 Jun 22, 2023
be7ceaf
fix: 修改禁言时间范围
ikechan8370 Jun 22, 2023
599f37e
fix: 修复一些功能易用性
ikechan8370 Jun 23, 2023
351597a
fix: 只有管理员和群主才能用jinyan和kickout
ikechan8370 Jun 23, 2023
ef72d88
fix: 加回来禁言和踢出
ikechan8370 Jun 23, 2023
2e679b5
fix: 修复管理员权限判断问题(可能吧)
ikechan8370 Jun 23, 2023
c5212a6
fix: 试图优化逻辑
ikechan8370 Jun 23, 2023
11dd66c
fix: fuck openai documents
ikechan8370 Jun 23, 2023
37b884a
fix: 删掉认主不然一直禁言我烦死了
ikechan8370 Jun 23, 2023
39478d2
fix: 哔哩哔哩封面损坏问题
ikechan8370 Jun 23, 2023
e192e51
fix: 加个天气小工具
ikechan8370 Jun 23, 2023
cd13b82
fix: 天气不存在城市
ikechan8370 Jun 23, 2023
ed33727
fix: website工具用浏览器
ikechan8370 Jun 23, 2023
9c07b4f
feat: serp tool
ikechan8370 Jun 23, 2023
7600895
feat: 增加一个google搜索源
ikechan8370 Jun 24, 2023
592e184
fix: 加一句描述
ikechan8370 Jun 24, 2023
8d13145
feat: 增加搜索来源选项
ikechan8370 Jun 24, 2023
5ccefa6
feat: 搜图和发图
ikechan8370 Jun 24, 2023
6d5a9ed
fix: groupId format error
ikechan8370 Jun 24, 2023
503a315
Merge branch 'wip2.7' of https://github.com/Qz-Sean/chatgpt-plugin in…
Qz-Sean Jun 24, 2023
407aa0c
Merge branch 'v2' of https://github.com/Qz-Sean/chatgpt-plugin into v2
Qz-Sean Jun 25, 2023
266edaf
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
Qz-Sean Jun 25, 2023
ee91b6d
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
Qz-Sean Jun 25, 2023
a502a72
Merge branch 'v2' of https://github.com/ikechan8370/chatgpt-plugin in…
Qz-Sean Jun 26, 2023
9e44f9a
Refactor: Optimized the HTML parsing rules
Qz-Sean Jun 26, 2023
f9682ba
fix: Fixed the bug where conversations could not be properly ended in…
Qz-Sean Jun 26, 2023
2ada6d8
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Jun 26, 2023
d7a34ff
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Jun 26, 2023
79d031d
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Jun 27, 2023
e26fbba
refactor: Added EliMovieTool and EliMusicTool. Modified some tool’s p…
Qz-Sean Jun 27, 2023
fecbf5d
Merge branch 'v2' of https://github.com/Qz-Sean/chatgpt-plugin into v2
Qz-Sean Jun 27, 2023
6734ffc
chore: trivial changes.
Qz-Sean Jun 27, 2023
7ed1f5c
refactor:Keep SearchMusicTool and SendMusicTool when avocado plugin i…
Qz-Sean Jun 27, 2023
1db4c34
Refactor: Move the parameter processing logic of some tools into each…
Qz-Sean Jun 28, 2023
c579683
Merge branch 'ikechan8370:v2' into v2
Qz-Sean Jun 28, 2023
03c0fb1
chore: Remove unnecessary log file🥑
Qz-Sean Jun 28, 2023
472ddac
refactor: Trivial changes and fixed a bug in QueryUserinfoTool.🥑
Qz-Sean Jun 28, 2023
9ff865d
Refactor: Rewrite blacklist and whitelist functionality, optimize cod…
Qz-Sean Jun 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 101 additions & 142 deletions apps/chat.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions apps/entertainment.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import plugin from '../../../lib/plugins/plugin.js'
import { Config } from '../utils/config.js'
import { generateHello } from '../utils/randomMessage.js'
import { generateAudio } from '../utils/tts.js'
import { generateVitsAudio } from '../utils/tts.js'
import fs from 'fs'
import { emojiRegex, googleRequestUrl } from '../utils/emoj/index.js'
import fetch from 'node-fetch'
Expand Down Expand Up @@ -304,7 +304,7 @@ ${translateLangLabels}
let sendable = message
logger.info(`打招呼给群聊${groupId}:` + message)
if (Config.defaultUseTTS) {
let audio = await generateAudio(message, Config.defaultTTSRole)
let audio = await generateVitsAudio(message, Config.defaultTTSRole)
sendable = segment.record(audio)
}
if (!groupId) {
Expand Down Expand Up @@ -362,7 +362,7 @@ ${translateLangLabels}
}
}
try {
audio = await generateAudio(message, defaultVitsTTSRole, '中日混合(中文用[ZH][ZH]包裹起来,日文用[JA][JA]包裹起来)')
audio = await generateVitsAudio(message, defaultVitsTTSRole, '中日混合(中文用[ZH][ZH]包裹起来,日文用[JA][JA]包裹起来)')
} catch (err) {
logger.error(err)
}
Expand Down
139 changes: 1 addition & 138 deletions apps/management.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
getVitsRoleList,
getVoicevoxRoleList,
makeForwardMsg,
parseDuration, processList,
parseDuration,
renderUrl
} from '../utils/common.js'
import SydneyAIClient from '../utils/SydneyAIClient.js'
Expand All @@ -20,8 +20,6 @@ import loader from '../../../lib/plugins/loader.js'
import VoiceVoxTTS, { supportConfigurations as voxRoleList } from '../utils/tts/voicevox.js'
import { supportConfigurations as azureRoleList } from '../utils/tts/microsoft-azure.js'

let isWhiteList = true
let isSetGroup = true
export class ChatgptManagement extends plugin {
constructor (e) {
super({
Expand Down Expand Up @@ -195,21 +193,6 @@ export class ChatgptManagement extends plugin {
fnc: 'enablePrivateChat',
permission: 'master'
},
{
reg: '^#chatgpt(设置|添加)对话[白黑]名单$',
fnc: 'setList',
permission: 'master'
},
{
reg: '^#chatgpt(查看)?对话[白黑]名单(帮助)?$',
fnc: 'checkList',
permission: 'master'
},
{
reg: '^#chatgpt(删除|移除)对话[白黑]名单$',
fnc: 'delList',
permission: 'master'
},
{
reg: '^#(设置|修改)管理密码',
fnc: 'setAdminPassword',
Expand Down Expand Up @@ -440,126 +423,6 @@ azure语音:Azure 语音是微软 Azure 平台提供的一项语音服务,
return true
}

async setList (e) {
this.setContext('saveList')
isWhiteList = e.msg.includes('白')
const listType = isWhiteList ? '对话白名单' : '对话黑名单'
await this.reply(`请发送需要添加的${listType}号码,默认设置为添加群号,需要添加QQ号时在前面添加^(例如:^123456)。`, e.isGroup)
return false
}

async saveList (e) {
if (!this.e.msg) return
const listType = isWhiteList ? '对话白名单' : '对话黑名单'
const regex = /^\^?[1-9]\d{5,9}$/
const wrongInput = []
const inputSet = new Set()
const inputList = this.e.msg.split(/[,,]/).reduce((acc, value) => {
if (value.length > 11 || !regex.test(value)) {
wrongInput.push(value)
} else if (!inputSet.has(value)) {
inputSet.add(value)
acc.push(value)
}
return acc
}, [])
if (!inputList.length) {
let replyMsg = '名单更新失败,请在检查输入是否正确后重新输入。'
if (wrongInput.length) replyMsg += `\n${wrongInput.length ? '检测到以下错误输入:"' + wrongInput.join(',') + '",已自动忽略。' : ''}`
await this.reply(replyMsg, e.isGroup)
return false
}
let [whitelist, blacklist] = processList(Config.whitelist, Config.blacklist)
whitelist = [...inputList, ...whitelist]
blacklist = [...inputList, ...blacklist]
if (listType === '对话白名单') {
Config.whitelist = Array.from(new Set(whitelist))
} else {
Config.blacklist = Array.from(new Set(blacklist))
}
let replyMsg = `${listType}已更新,可通过\n"#chatgpt查看${listType}" 查看最新名单\n"#chatgpt移除${listType}" 管理名单${wrongInput.length ? '\n检测到以下错误输入:"' + wrongInput.join(',') + '",已自动忽略。' : ''}`
if (e.isPrivate) {
replyMsg += `\n当前${listType}为:${listType === '对话白名单' ? Config.whitelist : Config.blacklist}`
}
await this.reply(replyMsg, e.isGroup)
this.finish('saveList')
}

async checkList (e) {
if (e.msg.includes('帮助')) {
await this.reply('默认设置为添加群号,需要拉黑QQ号时在前面添加^(例如:^123456),可一次性混合输入多个配置号码,错误项会自动忽略。具体使用指令可通过 "#指令表搜索名单" 查看,白名单优先级高于黑名单。')
return true
}
isWhiteList = e.msg.includes('白')
const list = isWhiteList ? Config.whitelist : Config.blacklist
const listType = isWhiteList ? '白名单' : '黑名单'
const replyMsg = list.length ? `当前${listType}为:${list}` : `当前没有设置任何${listType}`
await this.reply(replyMsg, e.isGroup)
return false
}

async delList (e) {
isWhiteList = e.msg.includes('白')
const listType = isWhiteList ? '对话白名单' : '对话黑名单'
let replyMsg = ''
if (Config.whitelist.length === 0 && Config.blacklist.length === 0) {
replyMsg = '当前对话(白|黑)名单都是空哒,请先添加吧~'
} else if ((listType === '对话白名单' && !Config.whitelist.length) || (listType === '对话黑名单' && !Config.blacklist.length)) {
replyMsg = `当前${listType}为空,请先添加吧~`
}
if (replyMsg) {
await this.reply(replyMsg, e.isGroup)
return false
}
this.setContext('confirmDelList')
await this.reply(`请发送需要删除的${listType}号码,号码间使用,隔开。输入‘全部删除’清空${listType}。${e.isPrivate ? '\n当前' + listType + '为:' + (listType === '对话白名单' ? Config.whitelist : Config.blacklist) : ''}`, e.isGroup)
return false
}

async confirmDelList (e) {
if (!this.e.msg) return
const isAllDeleted = this.e.msg.trim() === '全部删除'
const regex = /^\^?[1-9]\d{5,9}$/
const wrongInput = []
const inputSet = new Set()
const inputList = this.e.msg.split(/[,,]/).reduce((acc, value) => {
if (value.length > 11 || !regex.test(value)) {
wrongInput.push(value)
} else if (!inputSet.has(value)) {
inputSet.add(value)
acc.push(value)
}
return acc
}, [])
if (!inputList.length && !isAllDeleted) {
let replyMsg = '名单更新失败,请在检查输入是否正确后重新输入。'
if (wrongInput.length) replyMsg += `${wrongInput.length ? '\n检测到以下错误输入:"' + wrongInput.join(',') + '",已自动忽略。' : ''}`
await this.reply(replyMsg, e.isGroup)
return false
}
let [whitelist, blacklist] = processList(Config.whitelist, Config.blacklist)
if (isAllDeleted) {
Config.whitelist = isWhiteList ? [] : whitelist
Config.blacklist = !isWhiteList ? [] : blacklist
} else {
for (const element of inputList) {
if (isWhiteList) {
Config.whitelist = whitelist.filter(item => item !== element)
} else {
Config.blacklist = blacklist.filter(item => item !== element)
}
}
}
const listType = isWhiteList ? '对话白名单' : '对话黑名单'
let replyMsg = `${listType}已更新,可通过 "#chatgpt查看${listType}" 命令查看最新名单${wrongInput.length ? '\n检测到以下错误输入:"' + wrongInput.join(',') + '",已自动忽略。' : ''}`
if (e.isPrivate) {
const list = isWhiteList ? Config.whitelist : Config.blacklist
replyMsg = list.length ? `\n当前${listType}为:${list}` : `当前没有设置任何${listType}`
}
await this.reply(replyMsg, e.isGroup)
this.finish('confirmDelList')
}

async enablePrivateChat (e) {
Config.enablePrivateChat = !!e.msg.match(/(允许|打开|同意)/)
await this.reply('设置成功', e.isGroup)
Expand Down
25 changes: 22 additions & 3 deletions guoba.support.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,17 @@ export function supportGuoba () {
{
field: 'whitelist',
label: '对话白名单',
bottomHelpMessage: '只有在白名单内的QQ号或群组才能使用本插件进行对话。如果需要添加QQ号,请在号码前面加上^符号(例如:^123456),多个号码之间请用英文逗号(,)隔开。白名单优先级高于黑名单。',
bottomHelpMessage: '默认设置为添加群号。优先级高于黑名单。\n' +
'注意:需要添加QQ号时在前面添加^(例如:^123456),此全局添加白名单,即除白名单以外的所有人都不能使用插件对话。\n' +
'如果需要在某个群里独享moment,即群聊中只有白名单上的qq号能用,则使用(群号^qq)的格式(例如:123456^123456)。\n' +
'白名单优先级:混合制 > qq > 群号。\n' +
'黑名单优先级: 群号 > qq > 混合制。',
component: 'Input'
},
{
field: 'blacklist',
label: '对话黑名单',
bottomHelpMessage: '名单内的群或QQ号将无法使用本插件进行对话。如果需要添加QQ号,请在QQ号前面加上^符号(例如:^123456),并用英文逗号(,)将各个号码分隔开。',
bottomHelpMessage: '参考白名单设置规则。',
component: 'Input'
},
{
Expand Down Expand Up @@ -834,7 +838,22 @@ export function supportGuoba () {
setConfigData (data, { Result }) {
for (let [keyPath, value] of Object.entries(data)) {
// 处理黑名单
if (keyPath === 'blacklist' || keyPath === 'whitelist' || keyPath === 'blockWords' || keyPath === 'promptBlockWords' || keyPath === 'initiativeChatGroups') { value = value.toString().split(/[,,;;\|]/) }
if (keyPath === 'blockWords' || keyPath === 'promptBlockWords' || keyPath === 'initiativeChatGroups') { value = value.toString().split(/[,,;;\|]/) }
if (keyPath === 'blacklist' || keyPath === 'whitelist') {
// 6-10位数的群号或qq
const regex = /^\^?[1-9]\d{5,9}(\^[1-9]\d{5,9})?$/
const inputSet = new Set()
value = value.toString().split(/[,,;;|\s]/).reduce((acc, item) => {
item = item.trim()
if (!inputSet.has(item) && regex.test(item)) {
if (item.length <= 11 || (item.length <= 21 && item.length > 11 && !item.startsWith('^'))) {
inputSet.add(item)
acc.push(item)
}
}
return acc
}, [])
}
if (Config[keyPath] !== value) { Config[keyPath] = value }
}
// 正确储存azureRoleSelect结果
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
"random": "^4.1.0",
"undici": "^5.21.0",
"uuid": "^9.0.0",
"ws": "^8.13.0"
"ws": "^8.13.0",
"js-tiktoken": "^1.0.5",
"quick-lru": "6.1.1"

},
"optionalDependencies": {
"@node-rs/jieba": "^1.6.2",
Expand Down
Loading