Overview
TheAI Assistant Chat History
component is a pre-built user interface element designed to display the conversation history between users and an AI assistant within a chat application. It provides a structured and visually appealing way to present past interactions, making it easy for users to review previous messages and context.

Usage
Integration
AIAssistantChatHistory
, as a Composite Component, offers flexible integration options, allowing it to be launched directly via button clicks or any user-triggered action.
The following code snippet exemplifies how you can seamlessly integrate the GroupMembers component into your application.
- XML
- Java
- Kotlin
Actions
Actions dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.setOnItemClickListener
Function invoked when a chat history item is clicked, typically used to open an ai assistant chat screen.- Java
- Kotlin
YourActivity.java
setOnItemLongClick
Function executed when a user item is long-pressed, allowing additional actions like delete or block.- Java
- Kotlin
YourActivity.java
setOnNewChatClickListener
Function triggered when the new chat button is clicked, typically used to start a new conversation with the AI assistant.- Java
- Kotlin
YourActivity.java
setOnCloseClickListener
Function activated when the close button is clicked, usually to exit the chat history view.- Java
- Kotlin
YourActivity.java
Customization
TheAIAssistantChatHistory
component offers a variety of customization options to tailor its appearance and functionality to better fit your application’s needs. These customizations are categorized into three main areas: Style, Functionality, and Advanced.
Style
Using Style you can customize the look and feel of the component in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the component.
themes.xml
- Java
- Kotlin
To know more such attributes, visit the attributes file.
Functionality
These are a set of small functional customizations that allow you to fine-tune the overall experience of the component. With these, you can toggle the visibility of UI elements. Below is a list of customizations along with corresponding code snippetsMethods | Description | Code |
---|---|---|
setUser | Sets the user whose chat histories with the ai assistant need to be fetched. This is a required property for the component to function properly. | .setUser(user); |
setErrorStateVisibility | Used to toggle the visibility of the error state of the component | .setErrorStateVisibility(View.GONE); |
setEmptyStateVisibility | Used to toggle the visibility of the empty state of the component | .setEmptyStateVisibility(View.GONE); |