AI-generated Key Takeaways
-
MLKTextMessagerepresents a single chat message used for generating Smart Reply suggestions. -
It includes properties like
text,timestamp,userID, andisLocalUserto describe the message. -
You can create an
MLKTextMessageinstance using the designated initializer, providing the message details. -
The
isLocalUserproperty indicates if the message originated from the user receiving suggestions.
MLKTextMessage
@interface MLKTextMessage : NSObjectA single chat message, to be used as an array element for input to Smart Reply.
-
Text of the chat message.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull text; -
Timestamp of the chat message.
Declaration
Objective-C
@property (nonatomic, readonly) NSTimeInterval timestamp; -
User id of the message sender.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull userID; -
Indicates whether this message is from the user that the suggestions are generated for.
Declaration
Objective-C
@property (nonatomic, readonly) BOOL isLocalUser; -
Constructs a chat message.
Declaration
Objective-C
- (nonnull instancetype)initWithText:(nonnull NSString *)text timestamp:(NSTimeInterval)timestamp userID:(nonnull NSString *)userID isLocalUser:(BOOL)isLocalUser;Parameters
textChat message text
timestampTime of message in seconds calculated from Unix Time.
userIDUser ID of the message sender.
isLocalUserWhether this message is from the user that the suggestions are generated for.
-
Unavailable.
Declaration
Objective-C
- (nonnull instancetype)init;