Procházet zdrojové kódy

Update dialogue_manager: do not process HUMAN_INTERVENTION_END in normal state

StrayWarrior před 2 týdny
rodič
revize
57980cc536
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      dialogue_manager.py

+ 4 - 0
dialogue_manager.py

@@ -256,6 +256,10 @@ class DialogueManager:
                 # 未在聚合状态中,收到的聚合触发消息为过时消息,不应当处理
                 logger.warning(f"staff[{self.staff_id}], user[{self.user_id}]: received {message.type} in state {self.current_state}")
                 return False, None
+            if message.type == MessageType.HUMAN_INTERVENTION_END:
+                # 未在人工介入状态中,收到的人工介入结束事件为过时消息,不应当处理
+                logger.warning(f"staff[{self.staff_id}], user[{self.user_id}]: received {message.type} in state {self.current_state}")
+                return False, None
             if message.type != MessageType.AGGREGATION_TRIGGER and self.message_aggregation_sec > 0:
                 # 收到有内容的用户消息,切换到消息聚合状态
                 self.do_state_change(DialogueState.MESSAGE_AGGREGATING)