Automatically blurs the input when not prompting for a response
Automatically disables the input between prompts. This prevents users from sending messages when the bot is not prompting
Automatically focusses the input when prompted for a response
Automatically hides the input when not prompting for a response. This will also hide the input when there are suggestions available.
The unique user identification value for the chat bot
A set of initial messages to populate the chat view with. Changing this after mounting will do nothing.
The chat bot iterable. Determines how to talk to bots.
Determines the length of time to pause between chat bot messages
Delays the setting of the suggestions by a time period. This will cause a delayed render if set. By default, the suggestions are rendered at the same time as the incoming message which only causes one render of the new items
Invoked when a data has been received from the chat bot. Can be used modify the rendered data
the data that has been received from the chat bot iterator
the data to display as a message
Invoked when an iterator has signified that it is complete
Converts the incoming input into the correct data type
the raw input from the user
the converted data
Invoked when an error occurs in the iterator
Invoked when previous messages should be loaded. Most recent message should be first.
the current oldest loaded message
an array of previously stored messages in historical time order
A hook to determine when a new message has been created. Can be used to attach metadata to the message in a
WeakMap
. Use onSave
to save new messages.
Invoked when a message should be saved. It is assumed that the initialMessages
are already saved and will never
be provided to this function
the messages to save
the current bot
property
Invoked when the bot has suggested answer(s). Can be used to hook into the suggestions that are rendered. The suggestions array can even be modified. This is useful to filter suggestions, client side.
the suggested responses for the current data
the suggestions that should be rendered
A component that renders at the bottom of the list, above the user input. Can be used to provide suggested inputs values. Defaults to the Suggestions component. Can be used to insert custom elements at the end of the chat.