diff --git a/README.MD b/README.MD index b300100..b7e070d 100644 --- a/README.MD +++ b/README.MD @@ -39,10 +39,11 @@ Bubbles 是一个功能丰富的微信机器人框架,基于 [wcferry](https:/ ## 🔩 更新日志 -- 2025-10-13 由AI灵活进行思考/快速响应的决断 -- 2025-10-13 赋予泡泡 Agentic Retrival 的能力,可自由查看历史记录 -- 2025-09-25 支持完全的 Agentic Routing 驱动,无需用户感知 -- 2025-09-18 支持通过 “想想” 触发深度思考,且 DeepResearch 能动态改变思考深度 +- 2025-10-23 赋予 AI 可以主动进行回复的能力 +- 2025-10-13 由 AI 自主判断回复需要用 flash 还是 resoning 的模型 +- 2025-10-13 赋予 AI 可自由查看历史记录的能力(关键词搜索、时间轴搜索、偏差搜索) +- 2025-09-25 支持完全的 Agentic Routing 驱动,无需触发词 +- 2025-09-18 支持通过 “想想” 触发 resoning 的模型,DeepResearch 的思考深度由 AI 判断 - 2025-05-12 新增提醒、日程管理功能 - 2025-05-01 支持 DeepResearch - 之前的就先不记录了 diff --git a/robot.py b/robot.py index fc4a6e9..95811b9 100644 --- a/robot.py +++ b/robot.py @@ -52,6 +52,7 @@ class Robot(Job): self.wxid = self.wcf.get_self_wxid() # 获取机器人自己的wxid self.allContacts = self.getAllContacts() self._msg_timestamps = [] + self.group_random_reply_rate = 0.3 try: db_path = "data/message_history.db" @@ -334,7 +335,18 @@ class Robot(Job): # 调用handle_chitchat函数处理闲聊,传递完整的上下文 self._handle_chitchat(ctx, None) else: - pass + can_auto_reply = ( + not msg.from_self() + and ctx.text + and (msg.type == 1 or (msg.type == 49 and ctx.text)) + ) + if can_auto_reply: + rand_val = random.random() + if rand_val < self.group_random_reply_rate: + self.LOG.info( + f"触发群聊主动闲聊回复: 概率阈值={self.group_random_reply_rate}, 随机值={rand_val:.2f}" + ) + self._handle_chitchat(ctx, None) # 7.4 私聊消息,未被命令处理,进行闲聊 elif not msg.from_group() and not msg.from_self():