From a14af8e710ce17ec3d4f2697ddfb6d7c41093bcb Mon Sep 17 00:00:00 2001 From: shanmite Date: Mon, 1 Jun 2026 10:03:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ai=E6=A8=A1=E5=BC=8F=E5=B8=A6=E8=AF=9D?= =?UTF-8?q?=E9=A2=98=E5=92=8C=E9=94=99=E8=AF=AFat=E5=A5=BD=E5=8F=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/monitor.js | 10 +++++----- my_config.example.js | 2 +- test/ai.test.js | 4 ++-- test/dynamic_card.test.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/core/monitor.js b/lib/core/monitor.js index 3db7ca2..92572a1 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -282,7 +282,8 @@ class Monitor extends Searcher { reserve_lottery_wait, sneaktower, key_words, model, chatmodel, chat: chats, relay: relays, block_dynamic_type, max_create_time, is_imitator, - only_followed, at_users, blockword, blacklist, ai_comments_parm + only_followed, at_users, blockword, blacklist, ai_comments_parm, + ai_judge_parm, } = config, now_ts = Date.now() / 1000; @@ -455,15 +456,14 @@ class Monitor extends Searcher { if (!hasOfficialLottery && model[1] === '1') { if (hasEnv('ENABLE_AI_JUDGE')) { let msg = await getAiContent( - config.ai_judge_parm.url, - config.ai_judge_parm.body, - config.ai_judge_parm.prompt, + ai_judge_parm.url, + ai_judge_parm.body, + ai_judge_parm.prompt, lottery_info.des ); try { let msg_json = JSON.parse(msg); has_key_words = msg_json.has_key_words; - needTopic = msg_json.needTopic; needAt = msg_json.needAt; isLottery = has_key_words; log.info('ai判断抽奖', msg_json.more); diff --git a/my_config.example.js b/my_config.example.js index 5bc280d..8660c56 100644 --- a/my_config.example.js +++ b/my_config.example.js @@ -515,7 +515,7 @@ module.exports = Object.freeze({ 'model': 'Qwen/Qwen3-32B', 'enable_thinking': true, }, - prompt: '你是一个B站用户,需要判断动态内容是否是抽奖动态,以及参与条件,以json格式输出,仅需包含key:has_key_words(bool 是否是抽奖动态),needAt(bool 是否需要@),needTopic(bool 是否需要带话题),more(string 总结参与抽奖的条件).回答不要包含markdown标记文本,输出纯json文本' + prompt: '你是一个B站用户,需要判断动态内容是否是抽奖动态,以及参与条件,以json格式输出,仅需包含key:has_key_words(bool 是否是抽奖动态),needAt(bool 是否需要@自己的好友),more(string 总结参与抽奖的条件).回答不要包含markdown标记文本,输出纯json文本' }, ai_comments_parm: { diff --git a/test/ai.test.js b/test/ai.test.js index afe34f7..832f98c 100644 --- a/test/ai.test.js +++ b/test/ai.test.js @@ -3,7 +3,7 @@ const utils = require('../lib/utils.js'); const config = require('../lib/data/config'); (async () => { - await util.par_run([], [ + await util.par_run([0], [ // 0 async () => { let msg = await utils.getAiContent( @@ -12,7 +12,7 @@ const config = require('../lib/data/config'); config.ai_judge_parm.prompt, '#胜利女神新的希望# #nikke# \n【一周年评论盖楼挑战③】拿来吧妮……的表情包!\n\n指挥官的手机里,\n一定存着几张出场率超高的妮姬表情包吧?\n和妮姬们相遇的一周年已至,这些也成了旅途中的一段快乐印记~是时候公开自己的库存了yo!\n\n无论是新收新做的趣味表情,还是珍藏一年的经典老图——\n现在,让它们登场吧!\n\n评论区交出您的表情包库存,看看这一年谁的“收藏”最cool!!\n🎁我们将在6月9日于本条评论区随机抽选:\n▶1位指挥官赠送【周边大礼盒】× 1\n▶10位指挥官赠送【Q版印章小立牌】× 1\n\n💝盖楼目标达成奖励:\n5月20日~22日期间,参与【一周年评论盖楼挑战】系列话题活动! 当全平台评论数累计达成 【2026】 楼时,我们将从本平台参与系列话题活动的用户中额外抽取2位幸运指挥官,每人送出【哈曼卡顿音响】× 1!\n\n————————————\n✦《胜利女神:新的希望》一周年庆典版本「OLD TALES 尘封童话」现已上线!游戏多端互通,前往Bilibili游戏中心搜索《胜利女神:新的希望》即可下载。' ); - console.log(msg); + console.log(JSON.parse(msg)); msg = await utils.getAiContent( config.ai_comments_parm.url, config.ai_comments_parm.body, diff --git a/test/dynamic_card.test.js b/test/dynamic_card.test.js index 683982e..f790e4b 100644 --- a/test/dynamic_card.test.js +++ b/test/dynamic_card.test.js @@ -4,7 +4,7 @@ const searcher = require('../lib/core/searcher'); const util = require('./util'); (async () => { - await util.par_run([0], [ + await util.par_run([], [ // 0 async () => { let info = await bili_client.getOneDynamicByDyid('1207028214165143570');