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
Timeline row for a persisted assistant
AiChatMessage, rendering its content as Markdown.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected @Nullable com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.Component> Fields inherited from class io.jmix.aitoolsflowui.view.chat.renderer.component.AbstractTimelineItem
actor, ACTOR_CN, AVATAR_CONTAINER_CN, avatarContainer, BASE_CN, body, BODY_CN, header, HEADER_CN, time, TIME_CN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.vaadin.flow.component.ComponentcreateAvatar(String actorName) voidsetAiAvatarIconSupplier(@Nullable com.vaadin.flow.function.SerializableSupplier<com.vaadin.flow.component.Component> avatarIconSupplier) Sets the supplier of the avatar icon shown for this row.voidsetMessage(AiChatMessage message, boolean isFresh, String actorName) Renders the row for the given assistant message.Methods inherited from class io.jmix.aitoolsflowui.view.chat.renderer.component.AbstractTimelineItem
createActor, createAvatarContainer, createBody, createHeader, createRoot, createTime, initContent, initRow, setTimeMethods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElementMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
ASSISTANT_MESSAGE_CN
- See Also:
-
ASSISTANT_MESSAGE_REFRESH_CN
- See Also:
-
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
Renders the row for the given assistant message.- Parameters:
message- assistant message to displayisFresh- whether to highlight the row as just generatedactorName- 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, ornullto render no icon
-
createAvatar
- Specified by:
createAvatarin classAbstractTimelineItem
-