|
@@ -555,7 +555,7 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
requestParam.put("modelType","客户意向度");
|
|
requestParam.put("modelType","客户意向度");
|
|
|
// log.info("请求参数:{}", requestParam);
|
|
// log.info("请求参数:{}", requestParam);
|
|
|
|
|
|
|
|
- R aiResponse = CrmCustomerAiTagUtil.callAiService(requestParam, chatId,INTENTION_DEGREE_KEY);
|
|
|
|
|
|
|
+ R aiResponse = CrmCustomerAiTagUtil.callAiServiceIntegration(requestParam, chatId,INTENTION_DEGREE_KEY);
|
|
|
// JSONObject root = JSON.parseObject(JSONUtil.toJsonStr(aiResponse));
|
|
// JSONObject root = JSON.parseObject(JSONUtil.toJsonStr(aiResponse));
|
|
|
// System.out.println(aiResponse);
|
|
// System.out.println(aiResponse);
|
|
|
// 获取 data.responseData
|
|
// 获取 data.responseData
|
|
@@ -567,28 +567,28 @@ public class CrmCustomerAnalyzeServiceImpl extends ServiceImpl<CrmCustomerAnalyz
|
|
|
|
|
|
|
|
if (choices.isArray() && choices.size() > 0) {
|
|
if (choices.isArray() && choices.size() > 0) {
|
|
|
JsonNode contentNode = choices.get(0).path("message").path("content");
|
|
JsonNode contentNode = choices.get(0).path("message").path("content");
|
|
|
-
|
|
|
|
|
- if (contentNode.isTextual()) {
|
|
|
|
|
- String contentStr = contentNode.asText();
|
|
|
|
|
- // 将content字符串解析为JsonNode
|
|
|
|
|
- JsonNode contentArray = mapper.readTree(contentStr);
|
|
|
|
|
-
|
|
|
|
|
- if (contentArray.isArray() && contentArray.size() > 1) {
|
|
|
|
|
- JsonNode secondElement = contentArray.get(1);
|
|
|
|
|
- JsonNode textNode = secondElement.path("text");
|
|
|
|
|
-
|
|
|
|
|
- if (!textNode.isMissingNode()) {
|
|
|
|
|
- JsonNode contentInnerNode = textNode.path("content");
|
|
|
|
|
-
|
|
|
|
|
- if (contentInnerNode.isTextual()) {
|
|
|
|
|
- String innerJsonStr = contentInnerNode.asText();
|
|
|
|
|
- JsonNode innerJson = mapper.readTree(innerJsonStr);
|
|
|
|
|
- JsonNode userInfo = innerJson.path("userIntent");
|
|
|
|
|
- result = userInfo.asText();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ result = contentNode.asText();
|
|
|
|
|
+// if (contentNode.isTextual()) {
|
|
|
|
|
+// String contentStr = contentNode.asText();
|
|
|
|
|
+// // 将content字符串解析为JsonNode
|
|
|
|
|
+// JsonNode contentArray = mapper.readTree(contentStr);
|
|
|
|
|
+//
|
|
|
|
|
+// if (contentArray.isArray() && contentArray.size() > 1) {
|
|
|
|
|
+// JsonNode secondElement = contentArray.get(1);
|
|
|
|
|
+// JsonNode textNode = secondElement.path("text");
|
|
|
|
|
+//
|
|
|
|
|
+// if (!textNode.isMissingNode()) {
|
|
|
|
|
+// JsonNode contentInnerNode = textNode.path("content");
|
|
|
|
|
+//
|
|
|
|
|
+// if (contentInnerNode.isTextual()) {
|
|
|
|
|
+// String innerJsonStr = contentInnerNode.asText();
|
|
|
|
|
+// JsonNode innerJson = mapper.readTree(innerJsonStr);
|
|
|
|
|
+// JsonNode userInfo = innerJson.path("userIntent");
|
|
|
|
|
+// result = userInfo.asText();
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|