shanghui 3 hónapja
szülő
commit
0c414019b8
1 módosított fájl, 5 hozzáadás és 6 törlés
  1. 5 6
      src/core/voip/bot.py

+ 5 - 6
src/core/voip/bot.py

@@ -117,7 +117,7 @@ class MyAudioMediaPort(pj.AudioMediaPort):
     def get_asr_text(self):
         try:
             asr_text = self.call.user_asr_text_queue.get(block=False)
-            self.call.logger.info('get_asr_text:', asr_text)
+            self.call.logger.info('get_asr_text: %s', asr_text)
             return asr_text
         except:
             pass
@@ -371,7 +371,7 @@ class ToTextBotAgent:
             asrText=user_asr_text,
             ext= None
         )
-        self.call_agent.logger.info("user_asr_text发送结果:", user_asr_text)
+        self.call_agent.logger.info("user_asr_text发送结果: %s", user_asr_text)
         # 发送请求并处理响应
         # self.test_request(self.request_data)
         self.to_quest(self.request_data)
@@ -403,7 +403,7 @@ class ToTextBotAgent:
 
 # 模拟接口请求返回
     def test_request(self, params: BotChatRequest):
-        self.call_agent.logger.info("test_request::params=", params)
+        self.call_agent.logger.info("test_request::params= %s", params)
         response_data = {
             "node_id": "1.0",
             "contents": [],
@@ -415,7 +415,7 @@ class ToTextBotAgent:
             "inputType": "0"
         }
 
-        self.call_agent.logger.info("asrText:", params.asrText)
+        self.call_agent.logger.info("asrText: %s", params.asrText)
         if params.asrText == 'start':                              #欢迎语
             response_data['contents'].append({
                 "content_type": "voice",
@@ -454,7 +454,6 @@ class ToTextBotAgent:
                 }
             ]
         try:
-            self.call_agent.logger.info(json.dumps(response_data['contents']))
             parsed_response = ChatMessage.from_json(response_data)
             self.call_agent.message_queue.put(parsed_response)
         except Exception as e:
@@ -572,7 +571,7 @@ class BotAgent:
         acc = self.accounts.get(user_part)
         self.logger.info('register, user_part :%d, pool.size :%d', user_part, self.user_part_pool.qsize())
         if acc:
-            self.logger.info('register==========>', acc.getId())
+            self.logger.info('register==========> %s', acc.getId())
             # ps = pj.PresenceStatus()
             # ps.status = pj.PJSUA_BUDDY_STATUS_ONLINE
             # ps.activity = pj.PJRPID_ACTIVITY_AWAY