使用智能回复时在 Log-cat 中打印的消息
Messages printed in Log-cat while using Smart Reply
在 Fire base ML Kit 中,正在打印建议回复的消息列表 logcat
只需调用 FirebaseNaturalLanguage.getInstance().getSmartReply().suggestReplies(List samplelist) ,样本列表中发送的消息将在 Logcat
中打印
ArrayList messageList = new ArrayList<>();
messageList.add(新消息("Hello. How are you?", false, System.currentTimeMillis()));
List chatHistory = new ArrayList<>();
对于(消息消息:消息列表){
如果 (message.isLocalUser && !isEmulatingRemoteUser || !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(聊天记录)
.continueWith(新的延续>() {
@覆盖
public List then(@NonNull Task task) {
return task.getResult().getSuggestions();
}
});
观察结果:
在 logcat 中,给定的消息列表正在 logcat 中打印。
预期成绩:
给定的消息列表不应打印在 logcat.
中
同时更新 com.google.firebase:firebase-ml-natural-language
和 com.google.firebase:firebase-ml-natural-language-smart-reply-model
至 20.0.2
在 Fire base ML Kit 中,正在打印建议回复的消息列表 logcat
只需调用 FirebaseNaturalLanguage.getInstance().getSmartReply().suggestReplies(List samplelist) ,样本列表中发送的消息将在 Logcat
中打印ArrayList messageList = new ArrayList<>(); messageList.add(新消息("Hello. How are you?", false, System.currentTimeMillis()));
List chatHistory = new ArrayList<>(); 对于(消息消息:消息列表){ 如果 (message.isLocalUser && !isEmulatingRemoteUser || !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(聊天记录) .continueWith(新的延续>() { @覆盖 public List then(@NonNull Task task) { return task.getResult().getSuggestions(); } });
观察结果: 在 logcat 中,给定的消息列表正在 logcat 中打印。 预期成绩: 给定的消息列表不应打印在 logcat.
中同时更新 com.google.firebase:firebase-ml-natural-language
和 com.google.firebase:firebase-ml-natural-language-smart-reply-model
至 20.0.2