SuperAPI AI 工具集

cometchat-features

前端与建站

查看项目

更新于 10-16 05:03

技能介绍

用途:在已完成集成的 CometChat 项目中启用具体功能(通话、reactions、polls、文件分享、presence 等),并根据功能类型路由到正确的子流程。本技能对应 Web/React(@cometchat/chat-uikit-react);其他平台各有独立的功能技能,Flutter V5 无独立技能,代理至 cometchat-flutter-v6-features。配套技能包括 cometchat-core(初始化与 provider 模式)、cometchat-customization(启用后的视觉定制)、cometchat-troubleshooting(启用后故障)。

前置条件:需已有集成,可用 npx @cometchat/skills-cli info --json 检查;若 integrated 为 false,应先运行 /cometchat 完成集成。启用前需确认登录状态(cometchat auth status --json),且需有 .cometchat/config.json 或显式传入 --app-id;手动配置 .env 的用户可用 cometchat config save --app-id <id> --region <region> --json 补齐。

主要能力与分类:功能按启用所需工作量分为五类。第1类核心消息功能(如 Typing Indicators)开箱即用;第2类 Builder 启用(如 Polls)需通过 Dashboard API 开启并在 UI Kit Builder 中开关;第3类仅配置(如 Link Preview)通过 Dashboard API 启用后自动生效;第4类配置加设置(如 Smart Replies)还需额外设置;第5类 SDK 集成(如 Bitly)需 Dashboard 配置加客户端代码。前四类无需客户端代码。启用机制包括:default(编译进 UI Kit)、extension(后端布尔开关,用 cometchat apply-feature <id> 切换;原生环境加 --app-id)、ai-feature(需 OpenAI 密钥,如 cometchat apply-feature smart-replies --openai-key sk-...)、dashboard-only(第三方密钥或 webhook,需手动在 app.cometchat.com 配置)、package-install(通话需安装 @cometchat/calls-sdk-javascript@^5)、component-swap(替换组件变体)。注意:24 个仪表盘开关功能中约 7 个 auto_wired_in_uikit: true 才会自动渲染,约 17 个需客户端接入,可用 cometchat features info <id> --json 查看。

使用方式:按触发短语调用(如 /cometchat features reactions、/cometchat polls、/cometchat calls),或直接描述需求(如 “add reactions to my chat”)。启用后运行 cometchat verify 校验集成。自定义消息类型时,模板与附件选项必须与 UI Kit 默认值合并而非替换,否则会覆盖内置接口。

限制:功能清单与启用方式以官方文档为准;未提供的细节(价格、具体阈值等)资料未说明。扩展功能细节以本地目录为准。启用 moderation 时使用 Rules Management,避免与旧版扩展同时运行。