当我集成 rasa 聊天机器人(在 angular 应用程序中)时,我得到如下响应:
ÿ0{sid: "2c1c9f98ae4342708db3fc3ff68510ca", upgrades: ["websocket"], pingTimeout: 60000,…}
pingInterval: 25000
pingTimeout: 60000
sid: "2c1c9f98ae4342708db3fc3ff68510ca"
upgrades: ["websocket"]
0: "websocket"
我添加到我的 index.html 页面的代码是:
<script async="">!(function () {
let e = document.createElement("script"),
t = document.head || document.getElementsByTagName("head")[0];
(e.src =
"https://cdn.jsdelivr.net/npm/rasa-webchat@1.0.0/lib/index.js"),
// Replace 1.x.x with the version that you want
(e.async = !0),
(e.onload = () => {
try{
window.WebChat.default(
{
customData: { language: "en" },
socketUrl: "http://x.x.x.x:80",
socketPath:'/socket.io/',
title:'Rast test bot',
subtitle:'rasa test'
},
null
);
}catch(err){
console.log(err)
}
}),
t.insertBefore(e, t.firstChild);
})();
</script>
请问有什么解决办法吗?谢谢。