ShuanghongS преди 5 месеца
родител
ревизия
603170b441
променени са 2 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 1 0
      service/AIClientFactory.php
  2. 2 2
      service/robot.class.php

+ 1 - 0
service/AIClientFactory.php

@@ -194,6 +194,7 @@ class AIClientFactory
         }
 
         // Decode response
+        error_log("ai_return_data:".$response);
         $responseData = json_decode($response, true);
 
         if ($httpCode >= 400) {

+ 2 - 2
service/robot.class.php

@@ -884,8 +884,8 @@ class robot{
         if ($response_duration > 120){
             $answer_type = "Timeout";
         }
-        $request_content = common::check_input(json_encode($response['data']));
-        $ai_response_content = common::check_input(json_encode($response['full_response']));
+        $request_content = common::check_input(json_encode($response['data'],JSON_UNESCAPED_UNICODE));
+        $ai_response_content = common::check_input(json_encode($response['full_response'],JSON_UNESCAPED_UNICODE));
 
         //提前记录AI 返回,如果sql异常掉了的话,可以查找原因
         $updateSql = "update public.kln_robot_chat_log set answer_duration = '$response_duration',answer_template='$answer_template',