Browse Source

Update agent_service: warning empty response

StrayWarrior 2 weeks ago
parent
commit
320d0d157d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      agent_service.py

+ 3 - 1
agent_service.py

@@ -178,12 +178,14 @@ class AgentService:
         chat_response = self._call_chat_api(chat_config).strip()
 
         if response := agent.generate_response(chat_response):
-            logging.warning("user: {}, response: {}".format(user_id, response))
+            logging.warning(f"staff[{agent.staff_id}] user[{user_id}]: response: {response}")
             current_ts = int(time.time() * 1000)
             self.send_queue.produce(
                 Message.build(MessageType.TEXT, MessageChannel.CORP_WECHAT,
                               agent.staff_id, user_id, response, current_ts)
             )
+        else:
+            logging.warning(f"staff[{agent.staff_id}] user[{user_id}]: no response generated")
 
     def _call_chat_api(self, chat_config: Dict) -> str:
         if configs.get().get('debug_flags', {}).get('disable_llm_api_call', False):