SuperAPI AI 工具集

managing-webapp-agentforce-conversation-client

智能体与模型

查看项目

更新于 10-15 21:43

技能介绍

用途:在 React 应用(.tsx 或 .jsx 文件)中添加或修改 AgentforceConversationClient 组件,用于嵌入 Agentforce 对话客户端(聊天组件)。

主要能力:先检查组件是否已存在,通过 grep -r "AgentforceConversationClient" --include=".tsx" --include=".jsx" --exclude-dir=node_modules 搜索使用位置(不要打开同名实现文件)。校验 agentId 是否符合 ^0Xx[a-zA-Z0-9]{15}$(以 0Xx 开头、总长 18 位);缺失或占位值(如 "Placeholder"、"YOUR_AGENT_ID")需向用户索取真实 ID。默认使用包导入:import { AgentforceConversationClient } from "@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental"; 未安装时执行 npm install @salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental。仅在用户明确要求使用本地补丁组件时才用相对导入。更新时只改需变更的 props,保留其余 props,不要删除重建。

可用 props:agentId(必填)、inline(内联模式,省略为浮动)、width、height、headerEnabled、styleTokens(所有颜色/字体/间距样式)、salesforceOrigin 与 frontdoorUrl(自动解析)。样式只能通过 styleTokens 设置,不要用 containerStyle、style、className 或 CSS 文件。

适用场景:为 React 应用添加聊天挂件、嵌入 Agentforce 智能体、配置内联或浮动对话界面及主题样式。

限制与前置条件:需用户配置 Salesforce 设置——Setup → My Domain 中关闭 "Require first party use of Salesforce cookies";本地开发需在 Setup → Session Settings → Trusted Domains for Inline Frames 添加域名(如 localhost:3000)。组件不显示或认证失败时参考 troubleshooting 文档。复杂布局、深色主题等参考 examples.md,样式令牌见 style-tokens.md,常见错误见 constraints.md。资料未提供具体收费、价格或效果数据。