SmartReplyGenerator

  • SmartReplyGenerator suggests meaningful replies to a user input message.

  • A SmartReplyGenerator is created using SmartReply.getClient().

  • The close() method releases resources used by the SmartReplyGenerator.

  • The suggestReplies() method provides suggested replies based on a list of text messages.

  • Currently, only English is supported for generating smart replies.

public interface SmartReplyGenerator extends Closeable LifecycleObserver OptionalModuleApi

A SmartReply client for suggesting meaningful replies to a user input message.

A SmartReplyGenerator is created via SmartReply.getClient() .

Example:

SmartReplyGenerator smartReplyGenerator = SmartReply.getClient();
 

Public Method Summary

abstract void
close ()
Closes the underlying resources including models used for reply inference.
abstract Task<SmartReplySuggestionResult>
suggestReplies (List<TextMessage> textMessages)
Returns suggested meaningful replies to a text message.

Inherited Method Summary

From interface java.io.Closeable
abstract void
close()
From interface java.lang.AutoCloseable
abstract void
close()

Public Methods

public abstract void close ()

Closes the underlying resources including models used for reply inference.

public abstract Task<SmartReplySuggestionResult> suggestReplies (List<TextMessage> textMessages)

Returns suggested meaningful replies to a text message.

Currently, English is the only supported language.

Parameters
textMessages a list of messages from which the API generates smart replies.

The messages list should contain most recent conversation context for all users participating in the conversation in ascending chronological order (i.e. from oldest to newest). Internally, SmartReply considers the last 10 messages to generate reply suggestions.

Returns

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.