|
@@ -333,17 +333,6 @@ class AgentService:
|
|
return False
|
|
return False
|
|
return True
|
|
return True
|
|
|
|
|
|
- def send_response(self, staff_id, user_id, response, message_type: MessageType, skip_check=False):
|
|
|
|
- logger.warning(f"staff[{staff_id}] user[{user_id}]: response[{message_type}] {response}")
|
|
|
|
- if not skip_check and not self.can_send_to_user(staff_id, user_id):
|
|
|
|
- return
|
|
|
|
- current_ts = int(time.time() * 1000)
|
|
|
|
- self.send_rate_limiter.wait_for_sending(staff_id, response)
|
|
|
|
- self.send_queue.produce(
|
|
|
|
- MqMessage.build(message_type, MessageChannel.CORP_WECHAT,
|
|
|
|
- staff_id, user_id, response, current_ts)
|
|
|
|
- )
|
|
|
|
-
|
|
|
|
def send_multimodal_response(self, staff_id, user_id, response: Dict, skip_check=False):
|
|
def send_multimodal_response(self, staff_id, user_id, response: Dict, skip_check=False):
|
|
message_type = response["type"]
|
|
message_type = response["type"]
|
|
logger.warning(f"staff[{staff_id}] user[{user_id}]: response[{message_type}] {response}")
|
|
logger.warning(f"staff[{staff_id}] user[{user_id}]: response[{message_type}] {response}")
|