diff --git a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/chat/RESTfulChatResponse.java b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/chat/RESTfulChatResponse.java index c121a52a..ad5381ed 100644 --- a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/chat/RESTfulChatResponse.java +++ b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/chat/RESTfulChatResponse.java @@ -16,6 +16,7 @@ public class RESTfulChatResponse { private InteractiveChatElementType type; private JSONObject reqBody; private boolean isFile; + private boolean rateable; public RESTfulChatResponse(String text, HashMap hashMap, String type) { @@ -34,6 +35,9 @@ public RESTfulChatResponse(String text, HashMap hashMap if(value.expectsFile()){ isFile = true; } + if(value.isRateable()){ + rateable = true; + } icel.add(ice); } } @@ -92,4 +96,12 @@ public boolean isFile() { public void setFile(boolean isFile) { this.isFile = isFile; } + + public boolean isRateable() { + return rateable; + } + + public void setRateable(boolean rateable) { + this.rateable = rateable; + } } diff --git a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/IncomingMessage.java b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/IncomingMessage.java index e8ef1fa1..245a1649 100644 --- a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/IncomingMessage.java +++ b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/IncomingMessage.java @@ -19,6 +19,7 @@ public class IncomingMessage { String type; boolean openAIEnhance; boolean freezeMessageSend; + boolean isRateable; /** * Conversation Id for the message @@ -54,7 +55,7 @@ public static String replaceUmlaute(String orig) { public IncomingMessage(String intent, String NluID, Boolean containsFile, ArrayList responses, - String fileURL, String errorMessage, String type, String intentLabel, String followupType) { + String fileURL, String errorMessage, String type, String intentLabel, String followupType, Boolean isRateable) { if (intent != "") { this.intentKeyword = replaceUmlaute(intent); } else @@ -76,6 +77,7 @@ public IncomingMessage(String intent, String NluID, Boolean containsFile, ArrayL this.type = type; this.followupMessageType = followupType; this.intentLabel = intentLabel; + this.isRateable = isRateable; } public UUID getConversationId() { @@ -214,4 +216,13 @@ public void setFollowupMessageType(String followupMessageType) { public void setFreezeMessageSend(boolean flag) { this.freezeMessageSend = flag; } + + public boolean isRateable() { + return isRateable; + } + + + public void setRateable(boolean isRateable) { + this.isRateable = isRateable; + } } diff --git a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/Messenger.java b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/Messenger.java index 95938174..22859174 100644 --- a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/Messenger.java +++ b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/model/Messenger.java @@ -1088,7 +1088,7 @@ private Intent determineIntent(ChatMessage message, Bot bot) { } else { ArrayList empty = new ArrayList(); empty.add(""); - incMsg = new IncomingMessage(intentKeyword, "", false, empty, null, "", null, "", "text"); + incMsg = new IncomingMessage(intentKeyword, "", false, empty, null, "", null, "", "text", false); if (splitMessage.length > 1) { incMsg.setEntityKeyword(incMsg.getIntentKeyword()); } else { diff --git a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/parser/BotParser.java b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/parser/BotParser.java index d9464f25..5c1b67a1 100644 --- a/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/parser/BotParser.java +++ b/social-bot-manager/src/main/java/i5/las2peer/services/socialBotManagerService/parser/BotParser.java @@ -486,6 +486,7 @@ private IncomingMessage addIncomingMessage(String key, BotModelNode elem, BotCon String type = null; String intentLabel = null; String followupMessageType = null; + Boolean isRateable = null; // TODO: Reduce code duplication try{ @@ -521,7 +522,9 @@ private IncomingMessage addIncomingMessage(String key, BotModelNode elem, BotCon intentLabel = subVal.getValue(); } else if (name.contentEquals("Followup Message Type")) { followupMessageType = subVal.getValue(); - } + } else if (name.contentEquals("Rateable")){ + isRateable = Boolean.valueOf(subVal.getValue()); + } } } catch(Exception e){ System.out.println("Error: " + e.getMessage()); @@ -551,7 +554,7 @@ private IncomingMessage addIncomingMessage(String key, BotModelNode elem, BotCon throw new ParseBotException("Response is missing Type"); } - return new IncomingMessage(intentKeyword, NluID, containsFile, messages, fileURL, errorMessage, type, intentLabel, followupMessageType); + return new IncomingMessage(intentKeyword, NluID, containsFile, messages, fileURL, errorMessage, type, intentLabel, followupMessageType, isRateable); } private IntentEntity addIntentEntity(String key, BotModelNode elem, BotConfiguration config)