SuperAPI AI 工具集

cometchat-native-features

智能体与模型

查看项目

更新于 10-15 20:14

技能介绍

用途:在已可用的 CometChat React Native 集成之上添加功能。使用前需先完成 cometchat-native-core、cometchat-native-components 及 Expo 或 bare 模式基础集成。

主要能力:按五种机制分类功能并给出对应做法。Default 已内置,如即时消息、输入状态、已读回执、表情回应、回复、@提及、媒体上传、编辑删除、消息详情,直接渲染 CometChatMessageHeader、CometChatMessageList、CometChatMessageComposer。Extension 为后端布尔开关,如投票、贴纸、翻译、链接预览、协作白板、协作文档、缩略图,用 cometchat apply-feature <id> 后硬重载。AI 功能如智能回复、会话摘要、会话开场白,需 OpenAI 密钥:cometchat apply-feature smart-replies --openai-key sk-…。Package-install 如语音视频通话,需安装 @cometchat/calls-sdk-react-native 及 netinfo、background-timer、callstats、webrtc 等依赖并重建。Component-swap 用于自定义文本格式、消息模板、AI 智能体聊天历史。

使用方式:CLI 从 .cometchat/state.json 读取 app ID,认证走系统钥匙串;返回 applied、already-applied、auth-required、openai-key-required、manual-action-required、error 等状态。部分扩展 auto_wired_in_uikit 为 false,需在 CometChatUIKit.init 的 extensions 字段传入对应 ExtensionsDataSource。通话需在应用根部同时注册 CometChat.addCallListener 与 CometChatUIEventHandler.addCallListener,并挂载 CometChatIncomingCall、CometChatOutgoingCall、CometChatOngoingCall;不要给 IncomingCall 传 onAccept,OngoingCall 需 sessionID 与 callSettingsBuilder。

适用场景:为 RN 聊天应用增量添加扩展、AI 与通话能力。限制:真实 WebRTC 通话无法在 Jest 或 Maestro 中运行,需两台真机与 TURN 服务器;Giphy、Stipop、Tenor、Chatwoot、Intercom 等需手动配置。