Generate CometChat AI conversation starters from recent messages to help users begin new chat conversations.
Conversation Starter enables you to retrieve an initial message in a new conversation, often used to set the context for the conversation that is about to begin. This can be particularly useful for guiding users on how to interact within the chat or for delivering automated messages that engage users when they initiate a chat.
CometChat AI analyzes the user’s tone and writing style by reviewing recent messages sent by that user within the application.The SDK includes a method for retrieving conversation starters in a chat. This method returns an array containing three potential starters for the conversation.The number of messages to be fetched to generate relevant conversation starter is configurable. By default the CometChat AI takes the latest 1000 messages. This can be configured to specific timestamps as well.
Configuration
Value
lastNMessages
This will fetch specific number of messages.
fromTimestamp
This will fetch messages from a particular timestamp.
toTimestamp
This will fetch messages until a particular timestamp.
While using any configuration mentioned above a maximum of only1000 messages will be fetched.
Assuming the necessary prerequisites are met, Conversation Starter functions seamlessly starting from v4 of the Chat UI Kits. No additional code is required: once you enable Conversation Starter in the dashboard, the UI Kit renders the suggestions automatically. It is triggered when there are no messages in a conversation, and in the React UI Kit it appears inside the Message List component.For details on how each AI feature maps to a UI Kit component, see Smart Chat Features in the React UI Kit.