Explorar o código

Update agent_service: change get_user_tags

StrayWarrior hai 2 días
pai
achega
b27012dca1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      pqai_agent/agent_service.py

+ 1 - 1
pqai_agent/agent_service.py

@@ -346,7 +346,7 @@ class AgentService:
             logger.debug(f"staff[{staff_id}], user[{user_id}]: no messages to send")
 
     def can_send_to_user(self, staff_id, user_id) -> bool:
-        user_tags = self.user_relation_manager.get_user_tags(user_id)
+        user_tags = self.user_manager.get_user_tags([user_id]).get(user_id, [])
         white_list_tags = set(apollo_config.get_json_value("agent_response_whitelist_tags", []))
         hit_white_list_tags = len(set(user_tags).intersection(white_list_tags)) > 0
         staff_white_lists = set(apollo_config.get_json_value("agent_response_whitelist_staffs", []))