Selaa lähdekoodia

Update agent_service: add agent voice whitelist

StrayWarrior 1 kuukausi sitten
vanhempi
commit
1c028dfd76
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      pqai_agent/agent_service.py

+ 2 - 1
pqai_agent/agent_service.py

@@ -242,7 +242,8 @@ class AgentService:
                 resp = self._get_chat_response(user_id, agent, message_text)
                 if resp:
                     recent_dialogue = agent.dialogue_history[-10:]
-                    if len(recent_dialogue) < 2 or staff_id not in ('1688855931724582', '1688854492669990', '1688855614633374'):
+                    agent_voice_whitelist = set(apollo_config.get_json_value("agent_voice_whitelist"))
+                    if len(recent_dialogue) < 2 or staff_id not in agent_voice_whitelist:
                         message_type = MessageType.TEXT
                     else:
                         message_type = self.response_type_detector.detect_type(