google_mlkit_smart_reply 0.2.0 google_mlkit_smart_reply: ^0.2.0 copied to clipboard
A Flutter plugin to use Google's ML Kit Smart Reply API to automatically generate relevant replies to messages.
Google's ML Kit Smart Reply for Flutter #
A Flutter plugin to use Google's ML Kit Smart Reply API to automatically generate relevant replies to messages.
Getting Started #
Before you get started read about the requirements and known issues of this plugin here.
Usage #
Smart Reply #
Create an instance of SmartReply
final smartReply = SmartReply();
Add messages to the conversation
// For local user.
smartReply.addMessageToConversationFromLocalUser(message, timestamp);
// For remote user.
smartReply.addMessageToConversationFromRemoteUser(message, timestamp, userId);
Generate replies
final response = await smartReply.suggestReplies();
for (final suggestion in response.suggestions) {
print('suggestion: $suggestion');
}
Release resources with close()
smartReply.close();
Example app #
Find the example app here.
Contributing #
Contributions are welcome. In case of any problems look at existing issues, if you cannot find anything related to your problem then open an issue. Create an issue before opening a pull request for non trivial fixes. In case of trivial fixes open a pull request directly.