Let bot interrupt conversation

It is related to my previous question but I would like to separate them so as not to mix issues (Chatbot interface) Can a bot interrupt the user?

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.

Any ideas, suggestions, pages that can help me?

Thank you!

How do you know when it’s raining?

Whatever the answer is, when it’s raining, you should trigger the Rasa REST API which will itself trigger an action.

In endpoints.yml add:

action_endpoint:
 url: "http://localhost:5055/webhook"

and in credentials.yml add:

rest:

rasa:
  url: "http://localhost:5002/api"

Then you just POST a JSON with the following format to http://localhost:5055/webhook/

{
    "next_action": action_notify_raining,
    "sender_id": id_of_the_user_you_want_to_notify
}

I don’t quite know what you mean by you should trigger the Rasa REST API. I know action but class ActionHelloWorld(Action), that’s not what you mean, right?

And what exactly do you mean by you just POST a JSON with the following format to `http://localhost:5055/webhook/?

Sorry for my lack of knowledge but I am new to this and I have not found any information that clarifies things for me.

If you don’t know what REST, HTTP API, and POST mean, please look at this tutorial:

thank you I will see it

1 Like