Hello people, I am working with the Rasa REST API and an angular web application. I want to add a functionality in frontend where the user can go back to the previous slot or action, this may be even triggered by the back button from the browser.
It seems my stories are being executed right via the API, but when I stop making a request and want to go back to the previous part/action/slot in my Rasa Form, then select something and try to keep going, it does not recognize my actual position in the story and the whole user journey gets messy.
So, apparently the web application did jump back to the previous step but in the backend it did not. Now the frontend and backend are not synchronous and I have to restart the application in order to get proper results.
Does the Rasa API support some king of functionality as “going/moving to the previous step in the story” ?? How can I implement this behaviour?
Here is an example how I have integrated the API in frontend:
function send(text) {
var dataToSend = JSON.stringify({ "recipient_id": "user", "message": text }) $.ajax({ url: 'http://localhost:5005/webhooks/rest/webhook', // RASA API type: 'POST', headers: { 'Content-Type': 'application/json; charset=utf-8' }, dataType: "json", data: dataToSend, success: function (data, textStatus, xhr) { console.log(data); if (Object.keys(data).length !== 0) { for (i = 0; i < Object.keys(data[0]).length; i++) { if (Object.keys(data[0])[i] == "buttons") { addSuggestion(data[0]["buttons"]) } } } setBotResponse(data); }, error: function (xhr, textStatus, errorThrown) { console.log('Error in Operation'); setBotResponse('error'); } });
so that I can make the following request:
curl -XPOST http://localhost:5005/webhooks/rest/webhook -d ‘{“sender”: “default”, “message”: “hello”}’ -H “Content-type: application/json”
Any help is very welcome! Thnx