فهرست منبع

Update agent_service: strip response

StrayWarrior 2 هفته پیش
والد
کامیت
ebd42d77fe
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      agent_service.py

+ 2 - 1
agent_service.py

@@ -174,7 +174,8 @@ class AgentService:
         """处理LLM响应"""
         chat_config = agent.build_chat_configuration(user_message, self.chat_service_type)
         logging.debug(chat_config)
-        chat_response = self._call_chat_api(chat_config)
+        # FIXME(zhoutian): 临时处理去除头尾的空格
+        chat_response = self._call_chat_api(chat_config).strip()
 
         if response := agent.generate_response(chat_response):
             logging.warning("user: {}, response: {}".format(user_id, response))