|
@@ -111,9 +111,9 @@ class DialogueManager:
|
|
|
self.current_state, self.previous_state = self.state_cache.get_state(self.staff_id, self.user_id)
|
|
|
|
|
|
# 从数据库恢复对话状态
|
|
|
- last_message = self.history_dialogue_service.get_dialogue_history(self.staff_id, self.user_id, 1)
|
|
|
+ last_message = self.history_dialogue_service.get_dialogue_history(self.staff_id, self.user_id, 10)
|
|
|
if last_message:
|
|
|
- self.last_interaction_time = last_message[0]['timestamp']
|
|
|
+ self.last_interaction_time = last_message[-1]['timestamp']
|
|
|
else:
|
|
|
# 默认设置为24小时前
|
|
|
self.last_interaction_time = int(time.time() * 1000) - 24 * 3600 * 1000
|