Browse Source

Update agent_service: logging

StrayWarrior 1 week ago
parent
commit
ddc3e46682
1 changed files with 2 additions and 2 deletions
  1. 2 2
      agent_service.py

+ 2 - 2
agent_service.py

@@ -245,7 +245,7 @@ class AgentService:
                 should_initiate = False
 
             if should_initiate:
-                logger.warning("user: {}, initiate conversation".format(user_id))
+                logger.warning(f"user[{user_id}], tags{user_tags}: initiate conversation")
                 # FIXME:虽然需要主动唤起的用户同时发来消息的概率很低,但仍可能会有并发冲突 需要并入事件驱动框架
                 agent.do_state_change(DialogueState.GREETING)
                 try:
@@ -270,7 +270,7 @@ class AgentService:
                     agent.rollback_state()
                     logger.error("Error in active greeting: {}".format(e))
             else:
-                logger.debug("user: {}, do not initiate conversation".format(user_id))
+                logger.debug(f"user[{user_id}], do not initiate conversation")
 
     def _generate_active_greeting_message(self, agent: DialogueManager, user_tags: List[str]=None):
         chat_config = agent.build_active_greeting_config(user_tags)