Search code examples
firebase-mlkit

Messages printed in Log-cat while using Smart Reply


In the Fire base ML Kit, the message list given for suggesting reply is being printed in the logcat

Just call FirebaseNaturalLanguage.getInstance().getSmartReply().suggestReplies(List samplelist) , the messages sent in the samplelist being printed in Logcat

ArrayList messageList = new ArrayList<>(); messageList.add(new Message("Hello. How are you?", false, System.currentTimeMillis()));

List chatHistory = new ArrayList<>(); for (Message message : messageList) { if (message.isLocalUser && !isEmulatingRemoteUser || !message.isLocalUser && isEmulatingRemoteUser) { chatHistory.add(FirebaseTextMessage.createForLocalUser(message.text, message.timestamp)); } else { chatHistory.add(FirebaseTextMessage.createForRemoteUser(message.text, message.timestamp, REMOTE_USER_ID)); } } FirebaseNaturalLanguage.getInstance().getSmartReply().suggestReplies(chatHistory) .continueWith(new Continuation>() { @Override public List then(@NonNull Task task) { return task.getResult().getSuggestions(); } });

Observed Results: In the logcat, the message list given is being printed in logcat. Expected Results: Message list given should not be printed in logcat.


Solution

  • Update both com.google.firebase:firebase-ml-natural-language and com.google.firebase:firebase-ml-natural-language-smart-reply-model to 20.0.2