diff --git a/ui-kit/flutter/v6/ai-features.mdx b/ui-kit/flutter/v6/ai-features.mdx new file mode 100644 index 000000000..37859f577 --- /dev/null +++ b/ui-kit/flutter/v6/ai-features.mdx @@ -0,0 +1,117 @@ +--- +title: "AI Features" +sidebarTitle: "Smart Chat" +description: "Enhance user interaction with AI-powered conversation starters, smart replies, and conversation summaries in your Flutter app" +--- + +CometChat's AI capabilities greatly enhance user interaction and engagement in your application. Let's understand how the Flutter V6 UI Kit achieves these features. + + + + + +*** + +## Usage + +### Integration + +In V6, AI features are handled internally through `MessageTemplateUtils` — no explicit extension registration is needed. Simply enable the AI features from your [CometChat Dashboard](/fundamentals/ai-user-copilot/overview) and they work automatically. + + +**V6 Architecture Change:** In V5, AI features required explicit registration via `UIKitSettings.aiFeature` with classes like `AISmartRepliesExtension()`, `AIConversationStarterExtension()`, etc. In V6, this entire registration pattern has been removed. Enable AI features from the Dashboard and the UI Kit integrates them automatically. + + +*** + +## Conversation Starters + +When a user initiates a new chat, the UI Kit displays a list of suggested opening lines that users can select, making it easier for them to start a conversation. These suggestions are powered by CometChat's AI, which predicts contextually relevant conversation starters. + +For a comprehensive understanding and guide on implementing and using the Conversation Starters, refer to our specific guide on the [Conversation Starter](/fundamentals/ai-user-copilot/conversation-starter). + +Once you have successfully activated the [Conversation Starter](/fundamentals/ai-user-copilot/conversation-starter) from your CometChat Dashboard, the feature will automatically be incorporated into the [MessageList](/ui-kit/flutter/v6/message-list) Widget. + + + + + +## Smart Replies + +Smart Replies are AI-generated responses to messages. They can predict what a user might want to say next by analyzing the context of the conversation. This allows for quicker and more convenient responses, especially on mobile devices. + +For a comprehensive understanding and guide on implementing and using the Smart Replies, refer to our specific guide on the [Smart Replies](/fundamentals/ai-user-copilot/smart-replies). + +Once you have successfully activated the [Smart Replies](/fundamentals/ai-user-copilot/smart-replies) from your CometChat Dashboard, the feature will automatically be incorporated into the Action sheet of [MessageComposer](/ui-kit/flutter/v6/message-composer) Widget. + + + + + +## Conversation Summary + +The Conversation Summary feature provides concise summaries of long conversations, allowing users to catch up quickly on missed chats. This feature uses natural language processing to determine the main points in a conversation. + +For a comprehensive understanding and guide on implementing and using the Conversation Summary, refer to our specific guide on the [Conversation Summary](/fundamentals/ai-user-copilot/conversation-summary). + +Once you have successfully activated the [Conversation Summary](/fundamentals/ai-user-copilot/conversation-summary) from your CometChat Dashboard, the feature will automatically be incorporated into the Action sheet of [MessageComposer](/ui-kit/flutter/v6/message-composer) Widget. + + + + + +## AI Assist Bot + +The AI Assist Bot provides intelligent, context-aware responses to user queries within the chat. It can answer questions, provide suggestions, and assist users based on the conversation context. + +For a comprehensive understanding and guide on implementing and using the AI Assist Bot, refer to our specific guide on the [AI Assist Bot](/fundamentals/ai-user-copilot/ai-assist-bot). + +Once you have successfully activated the AI Assist Bot from your CometChat Dashboard, the feature will automatically be incorporated into the Action sheet of [MessageComposer](/ui-kit/flutter/v6/message-composer) Widget. + +## AI Assistant Chat History + +Use the `CometChatAIAssistantChatHistory` widget to display past AI interactions: + + + +```dart +CometChatAIAssistantChatHistory( + user: user, + style: CometChatAIAssistantChatHistoryStyle( + backgroundColor: const Color(0xFFFFFAF6), + ), +) +``` + + + +For more details, see the [AI Assistant Chat History](/ui-kit/flutter/ai-assistant-chat-history) guide. + +## V6 Architecture Changes + +| Aspect | V5 | V6 | +|---|---|---| +| Registration | `UIKitSettings.aiFeature = [AISmartRepliesExtension(), ...]` | Not needed — enable from Dashboard | +| Architecture | Extension decorator chain | `MessageTemplateUtils` static methods | +| Classes removed | — | `AISmartRepliesExtension`, `AIConversationStarterExtension`, `AIAssistBotExtension`, `AIConversationSummaryExtension`, `CometChatUIKitChatAIFeatures` | +| UI widgets | Preserved | Preserved | +| Custom AI flows | Via `CometChatUIKit.getDataSource()` | Via `MessageTemplateUtils` and direct template injection. See [Message Agentic Flow](/ui-kit/flutter/v6/guide-message-agentic-flow) | + +--- + +## Next Steps + + + + Display and manage conversation messages with AI-powered starters + + + Compose messages with smart replies and AI assistance + + + Learn more about AI features and configuration + + + Implement custom AI-driven message flows + + diff --git a/ui-kit/flutter/v6/call-features.mdx b/ui-kit/flutter/v6/call-features.mdx index 916cd9bf9..49daa8023 100644 --- a/ui-kit/flutter/v6/call-features.mdx +++ b/ui-kit/flutter/v6/call-features.mdx @@ -15,7 +15,7 @@ Since V6 is hosted on Cloudsmith, install via CLI: ```bash -dart pub add cometchat_chat_uikit:6.0.0-beta1 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/ +dart pub add cometchat_chat_uikit:6.0.0-beta2 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/ ``` @@ -28,7 +28,7 @@ Or add manually to `pubspec.yaml`: dependencies: cometchat_chat_uikit: hosted: https://dart.cloudsmith.io/cometchat/cometchat/ - version: 6.0.0-beta1 + version: 6.0.0-beta2 ``` diff --git a/ui-kit/flutter/v6/getting-started.mdx b/ui-kit/flutter/v6/getting-started.mdx index 71857eab1..89a045ada 100644 --- a/ui-kit/flutter/v6/getting-started.mdx +++ b/ui-kit/flutter/v6/getting-started.mdx @@ -45,7 +45,7 @@ To get started, create a new flutter application project. Since V6 is hosted on Cloudsmith (not pub.dev), run this command instead of the standard `flutter pub add`: ```bash -dart pub add cometchat_chat_uikit:6.0.0-beta1 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/ +dart pub add cometchat_chat_uikit:6.0.0-beta2 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/ ``` **2. Update Pubspec** @@ -56,7 +56,7 @@ Or add it manually to your `pubspec.yaml`: dependencies: cometchat_chat_uikit: hosted: https://dart.cloudsmith.io/cometchat/cometchat/ - version: 6.0.0-beta1 + version: 6.0.0-beta2 ``` Final `pubspec.yaml` @@ -78,7 +78,7 @@ dependencies: cometchat_chat_uikit: hosted: https://dart.cloudsmith.io/cometchat/cometchat/ - version: 6.0.0-beta1 + version: 6.0.0-beta2 cupertino_icons: ^1.0.8 @@ -156,6 +156,8 @@ UIKitSettings uiKitSettings = (UIKitSettingsBuilder() ..region = CometChatConfig.region ..appId = CometChatConfig.appId ..authKey = CometChatConfig.authKey + ..enableCalls = true + ..callingConfiguration = CallingConfiguration() ).build(); CometChatUIKit.init( @@ -218,6 +220,7 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'CometChat V6', theme: ThemeData(useMaterial3: true), + navigatorKey: CallNavigationContext.navigatorKey, home: const InitPage(), ); } @@ -246,7 +249,9 @@ class _InitPageState extends State { ..autoEstablishSocketConnection = true ..region = CometChatConfig.region ..appId = CometChatConfig.appId - ..authKey = CometChatConfig.authKey) + ..authKey = CometChatConfig.authKey + ..enableCalls = true + ..callingConfiguration = CallingConfiguration()) .build(); CometChatUIKit.init( diff --git a/ui-kit/flutter/v6/message-composer.mdx b/ui-kit/flutter/v6/message-composer.mdx index ba4b9b12d..bc808aab8 100644 --- a/ui-kit/flutter/v6/message-composer.mdx +++ b/ui-kit/flutter/v6/message-composer.mdx @@ -50,7 +50,7 @@ class _MessageComposerScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( - resizeToAvoidBottomInset: false, // REQUIRED — composer handles keyboard internally + resizeToAvoidBottomInset: true, // Default — ensures keyboard pushes content up body: Column( children: [ Expanded(child: CometChatMessageList(user: user)), diff --git a/ui-kit/flutter/v6/upgrading-from-v5.mdx b/ui-kit/flutter/v6/upgrading-from-v5.mdx index a67e572d1..27d5d9e40 100644 --- a/ui-kit/flutter/v6/upgrading-from-v5.mdx +++ b/ui-kit/flutter/v6/upgrading-from-v5.mdx @@ -65,7 +65,7 @@ MessageTemplateUtils.getAllMessageTemplates(); **Install V6 via CLI (hosted on Cloudsmith):** ```bash -dart pub add cometchat_chat_uikit:6.0.0-beta1 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/ +dart pub add cometchat_chat_uikit:6.0.0-beta2 --hosted-url https://dart.cloudsmith.io/cometchat/cometchat/ ``` Or add manually to `pubspec.yaml`: @@ -74,7 +74,7 @@ Or add manually to `pubspec.yaml`: dependencies: cometchat_chat_uikit: hosted: https://dart.cloudsmith.io/cometchat/cometchat/ - version: 6.0.0-beta1 + version: 6.0.0-beta2 ``` ### 5. State Management Migration (Advanced)