Browse Source

Update dialogue_manager: change default interaction time

StrayWarrior 1 month ago
parent
commit
627079ae6e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      pqai_agent/dialogue_manager.py

+ 4 - 2
pqai_agent/dialogue_manager.py

@@ -162,8 +162,8 @@ class DialogueManager:
                         self.unprocessed_messages.append(entry['content'])
                         break
         else:
-            # 默认设置为24小时前
-            self.last_interaction_time = int(time.time() * 1000) - 24 * 3600 * 1000
+            # 默认设置
+            self.last_interaction_time = int(time.time() * 1000) - minutes_to_get * 60 * 1000
         time_for_read = datetime.fromtimestamp(self.last_interaction_time / 1000).strftime("%Y-%m-%d %H:%M:%S")
         logger.debug(f"staff[{self.staff_id}], user[{self.user_id}]: state: {self.current_state.name}, last_interaction: {time_for_read}")
 
@@ -456,6 +456,8 @@ class DialogueManager:
 
     @staticmethod
     def is_time_suitable_for_active_conversation(time_context=None) -> bool:
+        if configs.get_env() == 'dev':
+            return True
         if not time_context:
             time_context = DialogueManager.get_time_context()
         if time_context in [TimeContext.MORNING,