CometChatAIAssistantChat
is a composite component that assembles the message header, message list, and message composer to provide an AI agent chat experience. It supports streaming responses, quick starter suggestions, “New Chat” to reset context, and a chat history sidebar.
CometChat.User
(the AI agent) is required to start the assistant chat.showBackButton
is true).
showCloseButton
is true).
Property | Description | Example |
---|---|---|
user | Required CometChat.User representing the AI agent. | user={agent} |
streamingSpeed | Characters-per-second speed for streaming replies. Default 30 . | streamingSpeed={50} |
suggestedMessages | Array of quick prompts for the empty state. | suggestedMessages=["Help", "Summarize"] |
hideSuggestedMessages | Hide the suggestions section. | hideSuggestedMessages={true} |
hideNewChat | Hide the New Chat button in header. | hideNewChat={true} |
hideChatHistory | Hide the History button/sidebar. | hideChatHistory={true} |
showBackButton | Show back button in header. | showBackButton |
showCloseButton | Show close button in header. | showCloseButton |
onBackButtonClicked | Back button handler. | onBackButtonClicked={() => {}} |
onCloseButtonClicked | Close button handler. | onCloseButtonClicked={() => {}} |
onError | Error handler. | onError={handleError} |
emptyView | Custom empty state for the list. | emptyView={<Empty/>} |
loadingView | Custom loading view. | loadingView={<Loading/>} |
errorView | Custom error view. | errorView={<Error/>} |
emptyChatGreetingView | Custom empty title (default uses metadata.greetingMessage or user name). | emptyChatGreetingView={<h3/>} |
emptyChatIntroMessageView | Custom empty subtitle (default uses metadata.introductoryMessage). | emptyChatIntroMessageView={<p/>} |
emptyChatImageView | Custom empty image. | emptyChatImageView={<img/>} |
aiAssistantTools | Provide tool/function handlers for the assistant. | aiAssistantTools={tools} |
headerItemView
, headerTitleView
, headerSubtitleView
, headerLeadingView
, headerTrailingView
, and headerAuxiliaryButtonView
. These customizations are done in the similar way as the Message Header component.
headerAuxiliaryButtonView
.CometChatAIAssistantTools
to enable tool/function calls during assistant replies.
emptyChatImageView
.
emptyChatGreetingView
prop.
emptyChatIntroMessageView
prop.