Skip to main content
// Smart Replies
const replies = await CometChat.getSmartReplies(receiverId, receiverType);

// Conversation Starter
const starters = await CometChat.getConversationStarter(receiverId, receiverType);

// Conversation Summary
const summary = await CometChat.getConversationSummary(receiverId, receiverType);

// Ask Bot
const answer = await CometChat.askBot(receiverId, receiverType, botUID, question);
Prerequisites: AI features enabled in CometChat Dashboard
Smart Chat Features provide SDK methods for AI-powered capabilities that enhance user productivity — suggested replies, conversation openers, summaries, and bot interactions. These features require AI to be enabled in the CometChat Dashboard. For dashboard configuration and UI Kit integration, see the AI User Copilot overview.

Smart Replies

Get AI-generated reply suggestions for a conversation. Returns an object with positive, negative, and neutral suggestions.
CometChat.getSmartReplies(receiverId, receiverType).then(
  (replies: Object) => {
    console.log("Smart replies:", replies);
  },
  (error: CometChat.CometChatException) => {
    console.log("Error:", error);
  }
);
ParameterTypeDescription
receiverIdstringUID or GUID of the conversation
receiverTypestringCometChat.RECEIVER_TYPE.USER or CometChat.RECEIVER_TYPE.GROUP

Conversation Starter

Get AI-generated opening lines for a new conversation. Returns an array of suggested messages.
CometChat.getConversationStarter(receiverId, receiverType).then(
  (starters: Array<string>) => {
    console.log("Conversation starters:", starters);
  },
  (error: CometChat.CometChatException) => {
    console.log("Error:", error);
  }
);

Conversation Summary

Get an AI-generated summary of a conversation. Returns a string summarizing the conversation.
CometChat.getConversationSummary(receiverId, receiverType).then(
  (summary: string) => {
    console.log("Conversation summary:", summary);
  },
  (error: CometChat.CometChatException) => {
    console.log("Error:", error);
  }
);

Ask Bot

Send a question to a specific AI bot and get a response.
CometChat.askBot(receiverId, receiverType, botUID, question).then(
  (answer: string) => {
    console.log("Bot response:", answer);
  },
  (error: CometChat.CometChatException) => {
    console.log("Error:", error);
  }
);
ParameterTypeDescription
receiverIdstringUID or GUID of the conversation context
receiverTypestringCometChat.RECEIVER_TYPE.USER or CometChat.RECEIVER_TYPE.GROUP
botUIDstringUID of the AI bot to query
questionstringThe question to ask the bot

Next Steps

AI Agents

Intelligent automated conversations with real-time streaming

AI Moderation

Automatically moderate messages with AI

Send Messages

Send text messages that trigger AI responses

Smart Chat Features Overview

Dashboard configuration and UI Kit integration