使用智能回复时以Log-cat打印的消息

时间:2019-06-10 07:39:19

标签: firebase-mlkit

在Fire base ML Kit中,为建议答复而给出的消息列表已打印在logcat中

只需调用FirebaseNaturalLanguage.getInstance()。getSmartReply()。suggestReplies(List samplelist),在样品列表中发送的消息就会在Logcat中打印

ArrayList messageList =新的ArrayList <>(); messageList.add(new Message(“ Hello。你好吗?”,false,System.currentTimeMillis()));

列表chatHistory = new ArrayList <>();       对于(Message message:messageList){           如果(message.isLocalUser &&!isE​​mulatingRemoteUser ||!message.isLocalUser && isEmulatingRemoteUser){               chatHistory.add(FirebaseTextMessage.createForLocalUser(message.text,                       message.timestamp));           }其他{               chatHistory.add(FirebaseTextMessage.createForRemoteUser(message.text,                       message.timestamp,REMOTE_USER_ID));           }       }      FirebaseNaturalLanguage.getInstance()。getSmartReply()。suggestReplies(chatHistory)               .continueWith(new Continuation>(){                   @Override                   然后公开列表(@NonNull Task task){                       返回task.getResult()。getSuggestions();                   }               });

观察结果: 在logcat中,给定的消息列表正在logcat中打印。 预期成绩: 给定的消息列表不应在logcat中打印。

1 个答案:

答案 0 :(得分:0)

同时更新com.google.firebase:firebase-ml-natural-languagecom.google.firebase:firebase-ml-natural-language-smart-reply-model20.0.2