Closed murtaza98 closed 4 years ago
I'd like to propose a new communication model for this App to interact with Rasa.
Currently, in #6, I've implemented a request-response model i.e the App will send a request to Rasa server with the user's question, and the RASA server will reply back with the appropriate response for the user's query.
This approach work's perfectly for synchronous messages, however, for asynchronous messages, this approach won't work. To handle asynchronous messages we will need a new endpoint as we did in Dialogflow's App. So in short, with this approach, we handle synchronous and asynchronous messages separately. This is what I'd like to improve with my proposed approach
I'd like to propose a generic approach to handle both synchronous and asynchronous messages. This is possible only with RASA using CallbackInput. As described there
The callback channel behaves very much like the rest input, but instead of directly returning the bot messages to the HTTP request that sends the message, it will call a URL you can specify to send bot messages.
So my plan is to expose a generic endpoint CallbackInput
in our app and supply its URL to RASA. Rasa will then send synchronous and asynchronous messages to this endpoint.
So this is my plan. Please let me know ur thoughts on it. Thanks :smile:
I didn't get why having just the approach based on the REST API endpoint will be beneficial if we can have both approaches just like we did for the Dialogflow App. Do you think that instead of returning the response you get synchronous, we should await another REST API request to return a message to the end-user? The REST API calls work through the network, so the server may face some problems such as latency, etc.. Do you really think that let the end-user awaiting a response will provide a better UX?
I'll be waiting for your feedback.
Hello @renatobecker
Thanks for ur feedback on this matter. Ur points are completely valid. Using callbacks would certainly add a slight delay.
However, there is a feature in Rasa called Reminders
. The way it works is if an intent gets triggered, then for this intent, the chatbot-developer can schedule a reminder
which will be triggered after N
seconds.
rest
endpointIf we use the rest
endpoint, it will work properly with synchronous responses, however, if asynchronous messages like reminders
are present, then it won't display those messages. Ideally, we would expect that rasa uses callback
to send this reminder messages, but it doesn't trigger the callback if we use rest
API.
Please note that in rasa u cannot use rest
and callback
together. I tried using it but it didn't work.
callback
endpointIf we use the callback
endpoint, both simple responses and reminders will be sent these callback endpoint. I agree with your point, that this might add a delay, however, if we follow this approach then our app can support reminder
messages from rasa
Main Tasks include