AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Package | cometchat_chat_uikit |
| Key components | CometChatAIAssistantChatHistory, CometChatMessageList, CometChatMessageComposer, CometChatMessageHeader |
| Init | CometChatUIKit.init(uiKitSettings) then CometChatUIKit.login(uid) |
| Entry point | AI agent user → AIAssistantChatScreen with AI-specific styling |
| Sample app | GitHub |
| Related | All Guides |
Components
| Component / Class | Role |
|---|---|
CometChatMessageHeader | Manages message interactions with AI-specific buttons |
CometChatMessageList | Displays messages with AI-specific styling |
CometChatMessageComposer | Composes messages with AI placeholders |
CometChatAIAssistantChatHistory | Displays previous AI conversation history |
CometChatAiAssistantBubbleStyle | Custom styling for AI chat bubbles |
AIConstants.aiRole | Constant to detect AI agent users |
Integration Steps
1. Detect AI Agent
Check if the user is an AI agent by their role.2. AI Chat Screen Setup
Create a screen for AI Assistant chat using standard message components with AI-specific styling.3. Message Header with AI Actions
Configure the message header with chat history and new chat buttons.4. AI Message List
Configure the message list with AI-specific styling and options.5. AI Composer
Configure the composer with AI-specific placeholder text.6. Custom AI Bubble Styling
Apply custom styles for AI chat bubbles using ThemeExtension.Feature Matrix
| Feature | Component / Method | Description |
|---|---|---|
| AI detection | AIConstants.aiRole | Check if user is AI agent |
| AI chat screen | AIAssistantChatScreen | Full AI chat interface |
| Chat history | CometChatAIAssistantChatHistory | Browse previous AI sessions |
| AI styling | CometChatAiAssistantBubbleStyle | Custom AI bubble appearance |
| New chat | onNewChatClicked() | Start fresh AI conversation |