Reputation: 11
I’m creating a chatbot a bit different from what we are used to use and I need help and advice. The idea is that the chatbot has an external interface as I have read that for the bot to start the conversation is necessary (correct me if it is not true), the problem is that I have never created an interface like this and when I have tried to take created projects and test them to see how it would look like I can not get it to work, I attach an example of how it looks once written rasa.
Example of a conversation:
(11:22) User:Hello
(11:22) Bot: Hello, how can I help you?
(11:23) User: What will the weather be like today?
(11:23) Bot: It will rain this afternoon.
(Stands by on hold)
(14:12) Bot: It's already raining.
(14:13) User: Will it rain for a long time?
(14:13) Bot: Yes, it will be raining for about three hours
I know how to do the first part, until the bot takes the initiative, but I don't know how to continue.
index.html:
<html>
<body>
<script>!(function () {
let e = document.createElement("script"),
t = document.head || document.getElementsByTagName("head")[0];
(e.src =
"https://cdn.jsdelivr.net/npm/[email protected]/lib/index.js"),
// Replace 1.x.x with the version that you want
(e.async = !0),
(e.onload = () => {
window.WebChat.default(
{
initPayload: '/greet',
customData: { language: "en" },
socketUrl: "http://localhost:5005",
// add other props here
},
null
);
}),
t.insertBefore(e, t.firstChild);
})();
</script>
</body>
</html>
credentials.yml:
# This file contains the credentials for the voice & chat platforms
# which your bot is using.
# https://rasa.com/docs/rasa/messaging-and-voice-channels
rest:
# # you don't need to provide anything here - this channel doesn't
# # require any credentials
#facebook:
# verify: "<verify>"
# secret: "<your secret>"
# page-access-token: "<your page access token>"
#slack:
# slack_token: "<your slack token>"
# slack_channel: "<the slack channel>"
# slack_signing_secret: "<your slack signing secret>"
socketio:
user_message_evt: user_uttered
bot_message_evt: bot_uttered
session_persistence: true
#mattermost:
# url: "https://<mattermost instance>/api/v4"
# token: "<bot token>"
# webhook_url: "<callback URL>"
# This entry is needed if you are using Rasa X. The entry represents credentials
# for the Rasa X "channel", i.e. Talk to your bot and Share with guest testers.
rasa:
url: "http://localhost:5002/api"
I have several questions:
Why if I type rasa shell the chatbot works correctly but if I type rasa run -m models --enable-api --cors "*" --debug
and open index.html
I get a blank.
[enter image description here][1]
How to make the second part even to test it with rasa shell?
Can you start the bot in different ways, for example, It is starting to rain and other times: It has stopped snowing?
Any ideas, suggestions, pages that can help me?
Thank you! [1]: https://i.sstatic.net/shcz0.png
Upvotes: 1
Views: 170
Reputation: 611
Why if I type rasa shell the chatbot works correctly but if I type rasa run -m models --enable-api --cors "*" --debug and open index.html I get a blank. enter image description here
I suggest using the official rasa chat widget as your frontend. If you have questions about it you can ask it in the rasa forum. If you found a bug, you can file a bug report in the rasa open source repo.
How to make the second part even to test it with rasa shell?
This documentation on how to get the bot to start the conversation with the user should help you get started.
Can you start the bot in different ways, for example, It is starting to rain and other times: It has stopped snowing?
You can send to the bot the trigger intent that will trigger the desired response from the bot. See answer to the question for details.
Upvotes: 1