@saurabh-m523 Hey, I was wondering if you happened to know how to solve the following situation:
My main goal is to allow the user to speak at the end of the form while the bot listens, but does nothing (since the form has ended). Then, after a time delay, I want the conversation session to restart.
I tried setting up this functionality with the “reminders” function, but the bot is NOT delaying in restarting the session:
relevant domain.yml
:
intents:
- goodbye
- TIMED_RESTART: {triggers: action_session_start}
actions:
- action_session_start
- utter_goodbye
Relevant actions:
class ActionGoodbye(Action):
"""Resets convo"""
def name(self):
return "utter_goodbye"
async def run(self, dispatcher, tracker, domain):
date = datetime.datetime.now() + datetime.timedelta(seconds=50)
reminder = ReminderScheduled(
"TIMED_RESTART",
trigger_date_time=date,
name="restart_reminder",
kill_on_user_message=False,
)
class ActionSessionStart(Action):
def name(self) -> Text:
return "action_session_start"
@staticmethod
def fetch_slots(tracker: Tracker) -> List[EventType]:
"""Collect slots that contain the user's name and phone number."""
slots = []
for key in ("zipCode", "yearBorn"):
value = tracker.get_slot(key)
if value is not None:
slots.append(SlotSet(key=key, value=value))
return slots
async def run(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[EventType]:
# the session should begin with a `session_started` event
events = [SessionStarted()]
# any slots that should be carried over should come after the
# `session_started` event
events.extend(self.fetch_slots(tracker))
# an `action_listen` should be added at the end as a user message follows
events.append(ActionExecuted("action_listen"))
return events
Anyone know how to get this working in Rasa ?