Merge pull request #690 from Dax233/pr#588

让提及的识别更精准
This commit is contained in:
SengokuCola
2025-04-07 20:55:27 +08:00
committed by GitHub
5 changed files with 52 additions and 12 deletions

View File

@@ -186,7 +186,8 @@ class ReasoningChat:
logger.info("触发缓冲,已炸飞消息列")
return
is_mentioned = is_mentioned_bot_in_message(message)
# 处理提及
is_mentioned, reply_probability = is_mentioned_bot_in_message(message)
# 计算回复意愿
current_willing = willing_manager.get_willing(chat_stream=chat)
@@ -194,7 +195,7 @@ class ReasoningChat:
# 意愿激活
timer1 = time.time()
reply_probability = await willing_manager.change_reply_willing_received(
real_reply_probability = await willing_manager.change_reply_willing_received(
chat_stream=chat,
is_mentioned_bot=is_mentioned,
config=global_config,
@@ -202,6 +203,8 @@ class ReasoningChat:
interested_rate=interested_rate,
sender_id=str(message.message_info.user_info.user_id),
)
if reply_probability != 1 or (groupinfo and (groupinfo.group_id not in global_config.talk_allowed_groups)):
reply_probability = real_reply_probability
timer2 = time.time()
timing_results["意愿激活"] = timer2 - timer1

View File

@@ -211,7 +211,8 @@ class ThinkFlowChat:
logger.info("触发缓冲,已炸飞消息列")
return
is_mentioned = is_mentioned_bot_in_message(message)
# 处理提及
is_mentioned, reply_probability = is_mentioned_bot_in_message(message)
# 计算回复意愿
@@ -226,7 +227,7 @@ class ThinkFlowChat:
# 意愿激活
timer1 = time.time()
reply_probability = await willing_manager.change_reply_willing_received(
real_reply_probability = await willing_manager.change_reply_willing_received(
chat_stream=chat,
is_mentioned_bot=is_mentioned,
config=global_config,
@@ -234,6 +235,8 @@ class ThinkFlowChat:
interested_rate=interested_rate,
sender_id=str(message.message_info.user_info.user_id),
)
if reply_probability != 1 or (groupinfo and (groupinfo.group_id not in global_config.talk_allowed_groups)):
reply_probability = real_reply_probability
timer2 = time.time()
timing_results["意愿激活"] = timer2 - timer1
logger.debug(f"意愿激活: {reply_probability}")