Interface AiMessage
- All Superinterfaces:
Serializable
Represents a message in an AI conversation.
- Author:
- Vaadin Ltd
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendText(String token) Appends text to the existing message content.getText()Gets the message text.getTime()Gets the timestamp of the message.Gets the name of the message sender.voidSets the message text.
-
Method Details
-
getText
String getText()Gets the message text.- Returns:
- the message text
-
setText
Sets the message text.- Parameters:
text- the message text to set
-
getTime
Instant getTime()Gets the timestamp of the message.- Returns:
- the timestamp when the message was created
-
getUserName
String getUserName()Gets the name of the message sender.- Returns:
- the sender name
-
appendText
Appends text to the existing message content.This method is used for streaming AI responses where tokens are appended incrementally as they arrive.
- Parameters:
token- the text to append
-