MLKitSmartReply Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
TextMessage
class TextMessage : NSObject
A single chat message, to be used as an array element for input to Smart Reply.
-
Text of the chat message.
Declaration
Swift
var text: String { get }
-
Timestamp of the chat message.
Declaration
Swift
var timestamp: TimeInterval { get }
-
User id of the message sender.
Declaration
Swift
var userID: String { get }
-
Indicates whether this message is from the user that the suggestions are generated for.
Declaration
Swift
var isLocalUser: Bool { get }
-
Constructs a chat message.
Declaration
Swift
init(text: String, timestamp: TimeInterval, userID: String, isLocalUser: Bool)
Parameters
text
|
|
timestamp
|
Time of message in seconds calculated from Unix Time.
|
userID
|
User ID of the message sender.
|
isLocalUser
|
Whether this message is from the user that the suggestions are generated for.
|
-
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-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["`TextMessage` objects represent individual chat messages with properties for text, timestamp, user ID, and local user status."],["These objects are primarily used as input for Smart Reply functionality."],["Each message is associated with sender information, content, and a timestamp indicating when it was sent."],["You can create a `TextMessage` instance using the designated initializer providing the necessary details."]]],["`TextMessage` represents a single chat message for Smart Reply input. It contains the `text` of the message, a `timestamp` indicating when it was sent, a `userID` identifying the sender, and a boolean `isLocalUser` flag to denote if the message is from the user for whom suggestions are being generated. Messages are created via `init(text:timestamp:userID:isLocalUser:)` method using message text, timestamp, sender id, and a bool.\n"]]