|
@@ -12,6 +12,7 @@ import rocketmq
|
|
from rocketmq import ClientConfiguration, Credentials, SimpleConsumer, FilterExpression
|
|
from rocketmq import ClientConfiguration, Credentials, SimpleConsumer, FilterExpression
|
|
|
|
|
|
from pqai_agent import configs
|
|
from pqai_agent import configs
|
|
|
|
+from pqai_agent.abtest.utils import get_abtest_info
|
|
from pqai_agent.agents.message_push_agent import MessagePushAgent, DummyMessagePushAgent
|
|
from pqai_agent.agents.message_push_agent import MessagePushAgent, DummyMessagePushAgent
|
|
from pqai_agent.configs import apollo_config
|
|
from pqai_agent.configs import apollo_config
|
|
from pqai_agent.data_models.agent_push_record import AgentPushRecord
|
|
from pqai_agent.data_models.agent_push_record import AgentPushRecord
|
|
@@ -56,6 +57,10 @@ class PushScanThread:
|
|
for staff_user in self.service.user_relation_manager.list_staff_users(staff_id=self.staff_id):
|
|
for staff_user in self.service.user_relation_manager.list_staff_users(staff_id=self.staff_id):
|
|
staff_id = staff_user['staff_id']
|
|
staff_id = staff_user['staff_id']
|
|
user_id = staff_user['user_id']
|
|
user_id = staff_user['user_id']
|
|
|
|
+ abtest_params = get_abtest_info(user_id).params
|
|
|
|
+ if abtest_params.get('agent_push_enabled', 'false').lower() != 'true':
|
|
|
|
+ logger.debug(f"User {user_id} not enabled agent push, skipping.")
|
|
|
|
+ continue
|
|
agent = self.service.get_agent_instance(staff_id, user_id)
|
|
agent = self.service.get_agent_instance(staff_id, user_id)
|
|
should_initiate = agent.should_initiate_conversation()
|
|
should_initiate = agent.should_initiate_conversation()
|
|
user_tags = self.service.user_relation_manager.get_user_tags(user_id)
|
|
user_tags = self.service.user_relation_manager.get_user_tags(user_id)
|