FirebaseTextMessage

public final class FirebaseTextMessage extends Object

This class is deprecated.
The standalone ML Kit SDK replaces this API. For more information, refer to the migration guide.

Represents a text message from a certain user in a conversation, providing context for SmartReply to generate reply suggestions.

Public Method Summary

static FirebaseTextMessage
createForLocalUser(String messageText, long timestampMillis)
Creates an instance of FirebaseTextMessage for a local user.
static FirebaseTextMessage
createForRemoteUser(String messageText, long timestampMillis, String remoteUserId)
Creates an instance of FirebaseTextMessage for a remote user.

Inherited Method Summary

Public Methods

public static FirebaseTextMessage createForLocalUser (String messageText, long timestampMillis)

Creates an instance of FirebaseTextMessage for a local user. The local user is the current user of the app's instance and is the user for which SmartReply is generating a reply.

Parameters
messageText the message content. We don't limit the length here, but the API works best for casual conversations with reasonable long messages.
timestampMillis timestamp of the message in milliseconds since midnight, January 1, 1970 UTC.

You can use, for example, java.lang.System.currentTimeMillis() to get the value.

public static FirebaseTextMessage createForRemoteUser (String messageText, long timestampMillis, String remoteUserId)

Creates an instance of FirebaseTextMessage for a remote user. Your local user may have a conversation with one or more remote users and providing context for messages your local user has received will help the API generate smart replies.

Parameters
messageText the message content.

The API does not limit length, but it does function optimally with reasonably long message in casual conversations.

timestampMillis timestamp of the message in milliseconds since midnight, January 1, 1970 UTC.

You can use, for example, java.lang.System.currentTimeMillis() to get the value.

remoteUserId A unique user ID representing a remote user if the local user is having a conversation with more than one remote user. FirebaseSmartReply is a stateless API, so there is no need to guarantee consistent user IDs across different API calls.