Commit 00aa7436 authored by Ajit Deshmukh's avatar Ajit Deshmukh

Replace WhatsAppBotUtility.java

parent a314b886
...@@ -104,7 +104,7 @@ public class WhatsAppBotUtility { ...@@ -104,7 +104,7 @@ public class WhatsAppBotUtility {
String intentResponse = callIntentService(request, intentParams, enterprise, whatsAppMessage, userInfo); String intentResponse = callIntentService(request, intentParams, enterprise, whatsAppMessage, userInfo);
BaseLogger.log("0", null, null, "[WhatsAppBotUtility] intentResponse " + intentResponse); BaseLogger.log("0", null, null, "[WhatsAppBotUtility] intentResponse " + intentResponse);
String visionReponse = ""; String visionReponse = "";
// Process the response and send back to user // Added parseVisionAssistantResponseJSON method in try catch block to handle the exception
try { try {
visionReponse = parseVisionAssistantResponseJSON(intentResponse, messageId); visionReponse = parseVisionAssistantResponseJSON(intentResponse, messageId);
BaseLogger.log("0", null, null, "[WhatsAppBotUtility] visionReponse (raw): " + visionReponse); BaseLogger.log("0", null, null, "[WhatsAppBotUtility] visionReponse (raw): " + visionReponse);
...@@ -114,9 +114,7 @@ public class WhatsAppBotUtility { ...@@ -114,9 +114,7 @@ public class WhatsAppBotUtility {
return "Failed to parse intent response"; return "Failed to parse intent response";
} }
// Remove real and escaped newlines
// visionReponse = visionReponse.replace("\n", " ").replace("\\n", " ");
// visionReponse = visionReponse.replace("\"", "\\\"");
BaseLogger.log("0", null, null, "[WhatsAppBotUtility] visionReponse (sanitized): " + visionReponse); BaseLogger.log("0", null, null, "[WhatsAppBotUtility] visionReponse (sanitized): " + visionReponse);
sendWhatsAppReply(integratedNumber, userPhone, visionReponse); sendWhatsAppReply(integratedNumber, userPhone, visionReponse);
return visionReponse; return visionReponse;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment