diff --git a/src/plugins/chat/bot.py b/src/plugins/chat/bot.py index 704a9a18d..56efd825d 100644 --- a/src/plugins/chat/bot.py +++ b/src/plugins/chat/bot.py @@ -216,7 +216,6 @@ class ChatBot: is_mentioned = is_mentioned_bot_in_message(message) reply_probability = await willing_manager.change_reply_willing_received( chat_stream=chat, - topic=topic[0] if topic else None, is_mentioned_bot=is_mentioned, config=global_config, is_emoji=message.is_emoji, diff --git a/src/plugins/willing/mode_classical.py b/src/plugins/willing/mode_classical.py index 1e17130be..dbd7cf3f7 100644 --- a/src/plugins/willing/mode_classical.py +++ b/src/plugins/willing/mode_classical.py @@ -28,7 +28,6 @@ class WillingManager: async def change_reply_willing_received(self, chat_stream: ChatStream, - topic: str = None, is_mentioned_bot: bool = False, config = None, is_emoji: bool = False, @@ -37,14 +36,14 @@ class WillingManager: """改变指定聊天流的回复意愿并返回回复概率""" chat_id = chat_stream.stream_id current_willing = self.chat_reply_willing.get(chat_id, 0) - - if topic and current_willing < 1: - current_willing += 0.2 - elif topic: - current_willing += 0.05 + + interested_rate = interested_rate * config.response_interested_rate_amplifier + + if interested_rate > 0.5: + current_willing += (interested_rate - 0.5) if is_mentioned_bot and current_willing < 1.0: - current_willing += 0.9 + current_willing += 1 elif is_mentioned_bot: current_willing += 0.05 @@ -53,7 +52,10 @@ class WillingManager: self.chat_reply_willing[chat_id] = min(current_willing, 3.0) - reply_probability = (current_willing - 0.5) * 2 + + reply_probability = min(max((current_willing - 0.5),0.03)* config.response_willing_amplifier * 2,1) + + reply_probability = reply_probability # 检查群组权限(如果是群聊) if chat_stream.group_info and config: diff --git a/template/bot_config_template.toml b/template/bot_config_template.toml index 16a28d96e..89ebbe162 100644 --- a/template/bot_config_template.toml +++ b/template/bot_config_template.toml @@ -20,14 +20,14 @@ alias_names = ["小麦", "阿麦"] [personality] prompt_personality = [ - "曾经是一个学习地质的女大学生,现在学习心理学和脑科学,你会刷贴吧", # 贴吧人格 - "是一个女大学生,你有黑色头发,你会刷小红书", # 小红书人格 - "是一个女大学生,你会刷b站,对ACG文化感兴趣" # b站人格 + "用一句话或几句话描述性格特点和其他特征", + "用一句话或几句话描述性格特点和其他特征", + "例如,是一个热爱国家热爱党的新时代好青年" ] personality_1_probability = 0.6 # 第一种人格出现概率 personality_2_probability = 0.3 # 第二种人格出现概率 personality_3_probability = 0.1 # 第三种人格出现概率,请确保三个概率相加等于1 -prompt_schedule = "一个曾经学习地质,现在学习心理学和脑科学的女大学生,喜欢刷qq,贴吧,知乎和小红书" +prompt_schedule = "用一句话或几句话描述描述性格特点和其他特征" [message] min_text_length = 2 # 与麦麦聊天时麦麦只会回答文本大于等于此数的消息