The LLM Chat component for Retool Apps
An interface for AI chat conversations.
Refer to Getting started with the LLM Chat component for more information about this component.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
assistantName
The name of the AI.
| Type | string |
| Format | Plain Text |
| Configurability | Inspector |
| Default | Retool AI |
Examples
false"Retool AI"
avatarFallback
The text that is displayed when there is no Image URL or icon.
| Type | string |
| Format | Plain Text |
| Configurability | Inspector |
| Default | null |
Examples
false"Jenny Appleseed"
avatarIcon
The icon that's displayed for the avatar.
| Type | string |
| Format | Icon Key |
| Configurability | Inspector |
| Default | null |
Examples
false"/icon:bold/user"
avatarSrc
The image URL to use for the avatar.
| Type | string |
| Format | URL |
| Configurability | Inspector |
| Default | null |
Examples
false"https://example.com/image.jpg"
data
The data.
| Type | string | number | boolean | object | array |
| Format | Custom data |
| Configurability | Inspector |
| Default | null |
emptyDescription
The description to display before the first message is sent.
| Type | string |
| Configurability | Inspector |
| Default | null |
emptyTitle
The title to display before the first message is sent.
| Type | string |
| Configurability | Inspector |
| Default | null |
hidden
Whether this object is hidden from view.
| Type | boolean |
| Format | True/False |
| Configurability | Inspector > Appearance > Hidden |
| Default | false |
Examples
falsetrue
id
The unique identifier (name).
| Type | string |
| Format | Plain Text |
| Configurability | Inspector |
| Default | llmChat1 |
Examples
falsequery1
falsebutton1
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
| Type | boolean |
| Format | True/False |
| Configurability | Inspector > Appearance > Advanced > Show on desktop |
| Default | false |
Examples
falsetrue
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
| Type | boolean |
| Format | True/False |
| Configurability | Inspector > Appearance > Advanced > Show on mobile |
| Default | true |
Examples
falsetrue
lastMessage
The last message message sent by the user.
| Type | string |
| Configurability | Read-only |
| Default | null |
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden is true.
| Type | boolean |
| Format | True/False |
| Configurability | Inspector > Appearance > Advanced > Maintain space when hidden |
| Default | false |
Examples
falsetrue
margin
The amount of margin to render outside.
| Type | string | |||||||||
| Format | Plain Text | |||||||||
| Configurability | Inspector > Spacing > Margin | |||||||||
| Allowed Values |
| |||||||||
| Default | 4px 8px |
Examples
false4px 8px
messageHistory
A list of messages previously sent and received.
| Type | array |
| Array values | string |
| Configurability | Read-only |
| Default | null |
placeholder
The text to display within the input field when there is no value.
| Type | string |
| Format | string |
| Configurability | Inspector > Content > Placeholder |
| Default | Enter a value |
Examples
falseEnter a value
queryTargetId
The ID of the query to send messageHistory to.
| Type | string |
| Configurability | Inspector |
| Default | null |
showEmptyState
Whether to display an empty state before a message is sent. Enabled by adding the Empty state add-on.
| Type | boolean |
| Configurability | Inspector |
| Default | null |
showHeader
Whether to show the header area.
| Type | boolean |
| Format | True/False |
| Configurability | Inspector > Content > Add-ons > Header > Appearance > Show header |
| Default | false |
Examples
falsetrue
showInEditor
Whether the component remains visible in the editor if hidden is true.
| Type | boolean |
| Format | True/False |
| Configurability | Inspector > Appearance > Advanced > Always show in edit mode |
| Default | false |
Examples
falsetrue
showTimestamp
Whether to display a timestamp for messages.
| Type | array |
| Array values | boolean |
| Configurability | Inspector |
| Default | null |
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
llmChat.clearHistory()
Examples
Clear the history from llmChat.
llmChat.clearHistory();
llmChat.clearValue()
Examples
Clear the current value of llmChat.
llmChat.clearValue();
llmChat.exportData(options)
llmChat.resetValue()
Examples
Reset the current value of llmChat.
llmChat.resetValue();
llmChat.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
llmChat.scrollIntoView(options)
Parameters
Object Properties
behavior
The scroll behavior.
| Type | string | ||||||
| Allowed Values |
|
block
The scroll position relative to the component.
| Type | string | ||||||||||
| Allowed Values |
|
Examples
Scroll the minimum amount to immediately bring llmChat into view.
llmChat.scrollIntoView({behavior: 'auto', block: 'nearest'});
llmChat.setHidden()
Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.
llmChat.setHidden(hidden)
Parameters
Examples
true
Examples
Hide llmChat.
llmChat.setHidden(true);
Unhide llmChat.
llmChat.setHidden(false);
llmChat.setShowHeader(showHeader)
Parameters
Examples
true
Examples
Show the header of llmChat.
llmChat.setShowHeader(true);
Hide the header of llmChat.
llmChat.setShowHeader(false);
llmChat.setValue(key, value)
Examples
Set the current value of llmChat to userValue.
llmChat.setValue(userValue);
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
| Event | Description |
|---|