require directed questions for xiaoniu replies

This commit is contained in:
liuwei
2026-04-07 15:21:45 +08:00
parent 5ca9a8d1d9
commit 9e95b805ec
2 changed files with 12 additions and 2 deletions

View File

@@ -29,7 +29,11 @@ class ResponsePlanner:
if trigger.get("is_question") and conversation_hints.get("has_recent_human_solver") and flow_state != "deep_engaged":
return False
if trigger.get("is_question"):
return True
if trigger.get("is_directed"):
return True
if acceptance_state == "warm" and flow_state == "deep_engaged" and trigger.get("priority", 0) >= 0.95:
return True
return False
if trigger.get("is_followup"):
return False
if trigger.get("is_social_call"):

View File

@@ -21,6 +21,7 @@ class TriggerResult:
trigger_type: str = "none"
priority: float = 0.0
is_question: bool = False
is_directed: bool = False
is_followup: bool = False
is_social_call: bool = False
is_returning_member: bool = False
@@ -42,13 +43,13 @@ class TriggerRouter:
result.trigger_type = "at_trigger"
result.priority = float(self.config.get("at_bot", 1.0))
result.should_respond = True
result.is_directed = True
result.reasons.append("is_at")
if self._is_question(content):
if result.priority < float(self.config.get("explicit_question", 0.95)):
result.trigger_type = "question_trigger"
result.priority = float(self.config.get("explicit_question", 0.95))
result.is_question = True
result.should_respond = True
result.reasons.append("question")
if memory_hints.get("is_followup"):
if result.priority < float(self.config.get("followup", 0.90)):
@@ -56,6 +57,7 @@ class TriggerRouter:
result.priority = float(self.config.get("followup", 0.90))
result.is_followup = True
result.should_respond = True
result.is_directed = True
result.reasons.append("followup")
topic = self._detect_topic(content_lower)
if topic:
@@ -69,6 +71,8 @@ class TriggerRouter:
result.trigger_type = result.trigger_type if result.trigger_type != "none" else "social_trigger"
result.priority = max(result.priority, float(self.config.get("social_call", 0.65)))
result.is_social_call = True
result.is_directed = True
result.should_respond = True
result.reasons.append("social_call")
elif self._is_light_social_moment(content_lower):
if result.priority < float(self.config.get("light_social", 0.45)):
@@ -76,6 +80,8 @@ class TriggerRouter:
result.priority = max(result.priority, float(self.config.get("light_social", 0.45)))
result.is_social_call = True
result.reasons.append("light_social")
if result.is_question and result.is_directed:
result.should_respond = True
if memory_hints.get("returning_member_state") in {"returning_member", "long_absent_member"}:
result.is_returning_member = True
result.reasons.append(memory_hints.get("returning_member_state"))