Package com.vaadin.flow.component.ai.ui
Interface AIMessageList
- All Superinterfaces:
Serializable
Interface for message list components that can display AI conversation
messages.
- Since:
- 25.3
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCallback for attachment click events in the message list. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a listener that is called when an attachment in the message list is clicked.addMessage(String text, String userName, List<AIAttachment> attachments) Creates a new message with the given parameters and attachments.default voidhideTypingIndicator(String userName) Hides the indication that the given participant is working on a response.default voidshowTypingIndicator(String userName) Shows an indication that the given participant is working on a response.
-
Method Details
-
addMessage
Creates a new message with the given parameters and attachments. Creates a new message with the given parameters and attachments and adds it to the list.- Parameters:
text- the initial message textuserName- the name of the message sender, notnullattachments- the list of attachments to include with the message- Returns:
- the created message instance, not
null
-
showTypingIndicator
Shows an indication that the given participant is working on a response. TheAIOrchestratorcalls this when a turn starts, and adds the assistant message only when the first part of the response arrives, so an implementation that wants to show progress before that needs to override this method. The default implementation does nothing.- Parameters:
userName- the name of the participant, notnull- Since:
- 25.4
-
hideTypingIndicator
Hides the indication that the given participant is working on a response. TheAIOrchestratorcalls this before adding the assistant message, and when a turn ends without a response. The default implementation does nothing.- Parameters:
userName- the name of the participant, notnull- Since:
- 25.4
-
addAttachmentClickListener
Adds a listener that is called when an attachment in the message list is clicked.- Parameters:
callback- the callback to invoke on attachment click
-