web - 将对话框流与网站小部件 ui 集成
问题描述
我想将我制作的 dialogflow 机器人集成到网站并更改徽标并使其在单击按钮时显示并保持浮动我尝试查看 webdemo 的源代码并将其复制粘贴到我的网站并编辑了 img src但没有任何解决方案?
解决方案
您可以使用kommunicate.io Web API 在您的网站中使用您的 dialogflow 应用程序。
您只需在网页的 JavaScript 代码中添加您的通信凭据(APP_ID)即可根据需要显示小部件。
<script type="text/javascript">
(function(d, m){
/*---------------- Kommunicate settings start ----------------*/
var kommunicateSettings = {
"appId": "<APP_ID>",
"conversationTitle":"<CONVERSATION_TITLE>",
"automaticChatOpenOnNavigation": true,
"popupWidget": true
/*
"onInit": function (){
// paste your code here
},
"botIds":["<BOT_ID_1>","<BOT_ID_2>"]
*/
};
/*----------------- Kommunicate settings end ------------------*/
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "https://widget.kommunicate.io/v2/kommunicate.app";
var h = document.getElementsByTagName("head")[0];
h.appendChild(s);
window.kommunicate = m;
m._globals = kommunicateSettings;
})(document, window.kommunicate || {});
使用本指南集成 Dialogflow。
希望这可以帮助。
推荐阅读
- python - BigQuery DataTransfer:StartManualTransferRunsRequest 的构造函数输入无效
- ibm-cloud - 更新 watsonplatform.net 端点以进行情绪分析,得到 404
- python - 带有网站 API 的 Python 电报价格机器人
- c# - System.InvalidOperationException:没有路由与提供的值匹配
- agora.io - Web RTC 的“unmute-audio”回调未触发
- python - 在传递可选参数时获取所有日志事件
- javascript - 使用 node.js 获取服务器 url
- r - R中特定行与前一行之间的滞后差异
- python-requests - jupyterlab:在笔记本中打开 HTML(使用远程连接)
- netsuite - 使用 Emp Center 角色的 Vendor Bill Approval 拒绝原因