소스 검색

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))