Class TimelineAssistantMessageItem

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.orderedlayout.HorizontalLayout>
io.jmix.aitoolsflowui.view.chat.renderer.component.AbstractTimelineItem
io.jmix.aitoolsflowui.view.chat.renderer.component.TimelineAssistantMessageItem
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, Serializable

public class TimelineAssistantMessageItem extends AbstractTimelineItem
Timeline row for a persisted assistant AiChatMessage, rendering its content as Markdown.
See Also:
  • Field Details

    • ASSISTANT_MESSAGE_CN

      protected static final String ASSISTANT_MESSAGE_CN
      See Also:
    • ASSISTANT_MESSAGE_REFRESH_CN

      protected static final String ASSISTANT_MESSAGE_REFRESH_CN
      See Also:
    • ASSISTANT_MESSAGE_MARKDOWN_CN

      protected static final String ASSISTANT_MESSAGE_MARKDOWN_CN
      See Also:
    • avatarIconSupplier

      protected @Nullable com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.Component> avatarIconSupplier
  • Constructor Details

    • TimelineAssistantMessageItem

      public TimelineAssistantMessageItem()
  • Method Details

    • setMessage

      public void setMessage(AiChatMessage message, boolean isFresh, String actorName)
      Renders the row for the given assistant message.
      Parameters:
      message - assistant message to display
      isFresh - whether to highlight the row as just generated
      actorName - actor display name shown in the header
    • setAiAvatarIconSupplier

      public void setAiAvatarIconSupplier(@Nullable com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.Component> avatarIconSupplier)
      Sets the supplier of the avatar icon shown for this row. The supplier must return a fresh component on every call.
      Parameters:
      avatarIconSupplier - supplier of the avatar icon, or null to render no icon
    • createAvatar

      protected com.vaadin.flow.component.Component createAvatar(String actorName)
      Specified by:
      createAvatar in class AbstractTimelineItem