> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-platform-docs-release.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Smart Chat Features

> Android SDK implementation examples for AI-powered Smart Chat features including Conversation Starter, Smart Replies, and Conversation Summary

This page contains Android SDK code examples for Smart Chat features. For feature documentation, setup instructions, and configuration options, see [Smart Chat Features](/fundamentals/smart-chat-features).

## How to Use AI Features with SDK

<Steps>
  <Step title="Enable in Dashboard">
    Login to [CometChat Dashboard](https://app.cometchat.com/login), select your app, then go to **Chat & Messaging → Features** and enable the AI feature.
  </Step>

  <Step title="Configure AI settings">
    Open the AI feature settings in the Dashboard to configure options like response style, language, etc.
  </Step>

  <Step title="Implement SDK methods">
    Use the code examples below to fetch AI-generated content.
  </Step>

  <Step title="Build your UI">
    Create UI components to display conversation starters, smart replies, and summaries.
  </Step>
</Steps>

***

## Conversation Starter

Retrieve AI-generated initial messages to start conversations.

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    val receiveId = ""
    val receiverType: String = CometChatConstants.RECEIVER_TYPE_USER
    val configuration = JSONObject()
    try {
        configuration.put("lastNMessages", 100)
    } catch (e: JSONException) {
        throw RuntimeException(e)
    }

    CometChat.getConversationStarter(
        receiveId,
        receiverType,
        configuration,
        object : CallbackListener<List<String?>?>() {
            fun onSuccess(strings: List<String?>) {
                Log.e(TAG, strings.toString())
            }
            override fun onError(e: CometChatException) {
                Log.e(TAG, e.getMessage())
            }
        }
    )
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    String receiveId = "";
    String receiverType = CometChatConstants.RECEIVER_TYPE_USER;

    JSONObject configuration = new JSONObject();
    try {
        configuration.put("lastNMessages", 100);
    } catch (JSONException e) {
        throw new RuntimeException(e);
    }

    CometChat.getConversationStarter(receiveId, receiverType, configuration, new CometChat.CallbackListener<List<String>>() {
        @Override
        public void onSuccess(List<String> strings) {
            Log.e(TAG, strings.toString());
        }
        @Override
        public void onError(CometChatException e) {
            Log.e(TAG, e.getMessage());
        }
    });
    ```
  </Tab>
</Tabs>

***

## Smart Replies

Retrieve AI-generated reply suggestions based on conversation context.

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    val receiverId: String = "UID/GUID"
    val receiverType: String = "user/group"
    val configuration = JSONObject()
    try {
        configuration.put("lastNMessages", 100)
    } catch (e: JSONException) {
        throw RuntimeException(e)
    }

    CometChat.getSmartReplies(
        receiverId,
        CometChatConstants.RECEIVER_TYPE_USER,
        configuration,
        object : CallbackListener<HashMap<String, String>>() {
            override fun onSuccess(smartReplies: HashMap<String, String>) {
                for (s in smartReplies.keys) {
                    Log.e(TAG, "Smart Reply: $s ${smartReplies[s]}")
                }
            }
            override fun onError(e: CometChatException) {
                Log.e(TAG, e.message)
            }
        }
    )
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    String receiverId = "UID/GUID";
    String receiverType = "user/group";
    JSONObject configuration = new JSONObject();
    try {
        configuration.put("lastNMessages", 100);
    } catch (JSONException e) {
        throw new RuntimeException(e);
    }

    CometChat.getSmartReplies(receiverId, CometChatConstants.RECEIVER_TYPE_USER, configuration, new CometChat.CallbackListener<HashMap<String, String>>() {
        @Override
        public void onSuccess(HashMap<String, String> smartReplies) {
            for (String s : smartReplies.keySet()) {
                Log.e(TAG, "Smart Reply: " + s + " " + smartReplies.get(s));
            }
        }
        @Override
        public void onError(CometChatException e) {
            Log.e(TAG, e.getMessage());
        }
    });
    ```
  </Tab>
</Tabs>

***

## Conversation Summary

Retrieve AI-generated summaries of conversations.

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    val receiverId = "UID/GUID"
    val receiverType = CometChatConstants.RECEIVER_TYPE_USER
    val configuration = JSONObject()

    try {
        configuration.put("lastNMessages", 100)
    } catch (e: JSONException) {
        throw RuntimeException(e)
    }

    CometChat.getConversationSummary(receiverId, receiverType, configuration,
        object : CometChat.CallbackListener<String>() {
            override fun onSuccess(s: String) {
                Log.e(TAG, s)
            }
            override fun onError(e: CometChatException) {
                Log.e(TAG, e.localizedMessage)
            }
    })
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    String receiverId = "UID/GUID";
    String receiverType = CometChatConstants.RECEIVER_TYPE_USER;
    JSONObject configuration = new JSONObject();
    try {
        configuration.put("lastNMessages", 100);
    } catch (JSONException e) {
        throw new RuntimeException(e);
    }

    CometChat.getConversationSummary(receiverId, receiverType, configuration, new CometChat.CallbackListener<String>() {
        @Override
        public void onSuccess(String s) {
            Log.e(TAG, s);
        }
        @Override
        public void onError(CometChatException e) {
            Log.e(TAG, e.getMessage());
        }
    });
    ```
  </Tab>
</Tabs>
