Rasa Webchat集成问题

问题描述 投票:0回答:1

嘿,我是Rasa的新手,所以当我尝试使用命令运行我的聊天机器人时

rasa run --credentials credentials.yml --cors null

聊天机器人仅在我使用其路径打开HTML文件时运行。

file:///C:/Users/ansel/PycharmProjects/rasabot/index.html

因此,我想知道是否可以在本地主机上运行HTML文件?当我在浏览器中输入http://localhost:5005时,它会给我:来自Rasa的Hello:1.8.1而不是实际网页

同样,当我重新运行rasa chatbot时,似乎并不能清除我以前的对话.....有什么办法可以改变这一点吗?

我的聊天机器人似乎也没有加载任何图像。

This is the issue I face currently.

这里是HTML代码:

<!DOCTYPE html>
<html>
<head>
    <title>Rasa Chatbot</title>
</head>
<body>

<div id="webchat"/>
<script src="https://storage.googleapis.com/mrbot-cdn/webchat-latest.js"></script>
// Or you can replace latest with a specific version
<script>
  WebChat.default.init({
    selector: "#webchat",
    initPayload: "/hello",
    customData: {"language": "en"}, // arbitrary custom data. Stay minimal as this will be added to the socket
    socketUrl: "http://localhost:5005",
    socketPath: "/socket.io/",
    title: "Chatbot",
</script>

</body>
</html>

非常感谢您的帮助,在此先感谢您。

python socket.io rasa-core rasa
1个回答
1
投票

要通过本地主机访问Chatwidget,您需要创建一个本地网络服务器。您可以使用npm lite-server

您的rasa服务器已经在使用Localhost端口5005。这就是聊天机器人的运行位置。

来自Rasa的Hello:1.8.1显示rasa服务器正常工作。


我假设您已使用botfronts rasa-webchat作为您的界面?

要删除聊天记录,您必须在chatwidget中实施类似的操作:

if(Websocket.CLOSED){
localStorage.clear();
//or 
sessionStorage.clear();
}

您可以在rasa-webchat ReadMe API Part中找到更多信息。

© www.soinside.com 2019 - 2024. All rights reserved.