Package org.vaadin.addons.asyntai
Class AsyntaiChat
java.lang.Object
com.vaadin.flow.component.Component
org.vaadin.addons.asyntai.AsyntaiChat
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasStyle,Serializable
@Tag("asyntai-chat")
public class AsyntaiChat
extends com.vaadin.flow.component.Component
Shows the Asyntai chat assistant. Add this component to a layout or a view.
It has no visible element of its own: the chat bubble sits in the corner of
the page and stays open when the user moves between views.
add(new AsyntaiChat("asyntai_1a2b3c4d5e6f"));
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUses the app-wide widget ID, for example from application.properties.AsyntaiChat(String widgetId) Uses this widget ID. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) setScriptUrl(String scriptUrl) Advanced.setUserContext(Map<String, ?> userContext) Sets data about the signed-in user that the assistant can use in its answers, for example the user's name and plan.Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, 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, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
AsyntaiChat
public AsyntaiChat()Uses the app-wide widget ID, for example from application.properties. -
AsyntaiChat
Uses this widget ID.- Parameters:
widgetId- the widget ID from the Install page of the Asyntai dashboard. It starts with asyntai_.
-
-
Method Details
-
setUserContext
Sets data about the signed-in user that the assistant can use in its answers, for example the user's name and plan.- Parameters:
userContext- names and values: text, numbers, booleans, lists or nested maps- Returns:
- this component
-
setScriptUrl
Advanced. Loads the widget from another URL.- Parameters:
scriptUrl- the URL of the widget script- Returns:
- this component
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-