nik202
(NiK202)
July 3, 2021, 12:51pm
22
@ronankff Sure Please.
@erohmensing Hi,
Here is an example of my code.
In a FormAction, I would like for the user to be able to correct his answer and go back to the former question.
For example, the bot will ask for the name (“nom”) and the user will write it. The bot will then ask for the surname. At that moment, if the user write “retour”, the bot should ask again for the name (and put the right value in the slot).
action.py
Class CreateForm(FormAction):
“”“Example of a custom form action”""
def name(self):
…
@ronankff
OK, in case anyone is still struggling with the Mapping Policy of Rasa 1.0, this is what I did to make it work:
Put this in endpoints.yml
action_endpoint:
url: "http://localhost:5055/webhook"
Create an actions.py in your working folder with your custom action. For me, this was:
from rasa_sdk import Action
from rasa_sdk.events import UserUtteranceReverted
class FaqEnrollment(Action):
"""Revertible mapped action for utter_faq_enrollment"""
def name(self):
return "action_fa…
@ronankff
import copy
import json
import logging
from typing import (
List,
Text,
Optional,
Dict,
Any,
TYPE_CHECKING,
Tuple,
Set,
cast,
)
import aiohttp
import rasa.core
from rasa.core.actions.constants import DEFAULT_SELECTIVE_DOMAIN, SELECTIVE_DOMAIN
from rasa.core.constants import (
DEFAULT_REQUEST_TIMEOUT,
This file has been truncated. show original
@ronankff
@ronankff Honestly, I have seen so many examples, and want to provide at-most help. But, some process is hard to implement, so as a developer we found the atternative. If I found any more links or even solution; I will post here. Cheers!
1 Like