SmartReply
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eSmartReply\u003c/code\u003e is the entry point for generating smart replies to text input using ML Kit.\u003c/p\u003e\n"],["\u003cp\u003eIt provides a \u003ccode\u003egetClient()\u003c/code\u003e method to create a \u003ccode\u003eSmartReplyGenerator\u003c/code\u003e instance.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSmartReplyGenerator\u003c/code\u003e suggests replies based on provided conversation history.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers need to call \u003ccode\u003eSmartReplyGenerator.close()\u003c/code\u003e to release resources when finished.\u003c/p\u003e\n"]]],["The `SmartReply` class provides access to a `SmartReplyGenerator` for suggesting text replies. You can retrieve a `SmartReplyGenerator` instance using the `getClient()` method, optionally with `SmartReplyGeneratorOptions`. This generator is used to provide reply suggestions for text input. The `SmartReplyGenerator.close()` method must be called when the generator is no longer needed to release resources. `SmartReply` inherits several methods from the `Object` class, such as `clone()`, `equals()`, and `toString()`.\n"],null,["# SmartReply\n\npublic class **SmartReply** extends [Object](https://developer.android.com/reference/java/lang/Object.html) \nEntry point to get a [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator)\nthat suggests replies for a given text input.\n\nA [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator)\nis created via [getClient()](/android/reference/com/google/mlkit/nl/smartreply/SmartReply#getClient()).\n\nExample: \n\n SmartReplyGenerator smartReplyGenerator = SmartReply.getClient(); \n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator) | [getClient](/android/reference/com/google/mlkit/nl/smartreply/SmartReply#getClient(com.google.mlkit.nl.smartreply.SmartReplyGeneratorOptions))([SmartReplyGeneratorOptions](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGeneratorOptions) options) Returns a new [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator) that suggests replies for a given text input. |\n| static [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator) | [getClient](/android/reference/com/google/mlkit/nl/smartreply/SmartReply#getClient())() Returns a new [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator) that suggests replies for a given text input. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|\n| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](https://developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public static [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator)\n**getClient** ([SmartReplyGeneratorOptions](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGeneratorOptions) options)\n\nReturns a new [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator)\nthat suggests replies for a given text input. \n\n#### public static [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator)\n**getClient** ()\n\nReturns a new [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator)\nthat suggests replies for a given text input.\n\nTo release the resources associated with an [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator),\nyou need to ensure that [SmartReplyGenerator.close()](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator#close())\nis called on the resulting [SmartReplyGenerator](/android/reference/com/google/mlkit/nl/smartreply/SmartReplyGenerator)\ninstance once it will no longer be used."]]