How to utter something after conversation is restarted?

I was wondering when I clicked on Restart button on the guest conversation the bubble just keep buffering without any output. So how to set the output after the user restart the conversation?

Currently this is the story when restarting:

 ## restart
* restart
    - action_restart
    - utter_greet
    - utter_assist
    - utter_btn_Main

This is the output when I restart the conversation.

Capture1

You could overwrite the ActionRestart() with a custom action action and add some additional events here. Since the tracker is restarted, it won’t have any record of that action happening and so the story you put doesn’t work.

I have tried using different code and failed several time but the codes under returned the error please comment on where to change. dispatcher.utter_message("Restarted") is the message that I want the bot to send when the chat is restarted.

class ActionRestarted(Action):
""" This is for restarting the chat"""

def name(self) -> Text:
    return "action_restart"

async def run(
        self,
        tracker: Tracker,
        dispatcher: CollectingDispatcher,
        domain: Dict[Text, Any],) -> List[Event]:
    from rasa.core.events import Restarted

    # only utter the template if it is available
    evts = await super().run(tracker, domain, dispatcher.utter_message("Restarted"))
    return evts + [Restarted()]

AttributeError: ‘Tracker’ object has no attribute ‘utter_message’

@akelad I’m having the same problem, I want to restart the conversation (set the slots to null) if the user denies the validation of the proposed solution

This is my story :

and the assistant follows it, it restarts the conversation but then there is action_listen that is run

Thank you :slight_smile:

@nik202 do you have any idea how to deal with this ? thank you :slight_smile:

@AminaDerouiche

Do you want that your bot initiate the conversation, right? Or restart the process at any time. Please give me a clear idea.

I have performed both the process in my bot.

For example:

Bot: Hello, My name is Amina! How may I help you today?

User: Hello

OR

Bot: Are you satisfied with the answer (Feedback after the query)

Yes | No (Buttons)

User: No

Bot: Hello, My name is Amina! How may I help you today?

and so on.

Give me a clear example please.

Can I know which Front End are you using for the deployment of your bot?

Thank you @nik202 for the quick comeback I want to make sure that the solution I propose to the use it the right one so the conversation will be

  • bot : did I answer your question?
  • user: no
  • bot: I’m specialised in insurance, How can I help you ?

so the bot have been talking to the user before but at the last step which a validation the user said oops that’s not what I want so the slots that were filled are wrong I need to restart it from scratch

so I will restart the process once I get that what I’m offering the user is not what he is looking for

I’m still working in local mode

did I answer your questions ?

1 Like

@AminaDerouiche It’s ok.

I will suggest that on feedback yes or no (deny) just on deny add the new story:

For example:

domain.yml

utter_feedback:

  • text: Did that help? buttons:
    • title: Yes payload: what every you want you can add in this i.e story
  • title: No payload: /deny

story.yml

-story: deny steps:

  • intent: deny
  • action: utter_welcome or ask again question utterance or create any new utterance with buttons etc it’s up to you. :slight_smile:

Well, basically if the bot does not answer the user query, it will have a minimum confidence score and enter in default fallback state ( whatever message you want to show), this will happen when you do not have that question in the Knowledge base.

Or if the bot does not answer the user query, you can trigger the payload as I showed you above.

Note:

I will suggest and encourage you not to start the fresh process rather than create some story like I am sorry to hear that I am unable to help you, show some options: please ask another question or paraphrase the questions please or will connect with you live support, etc.

Tips for deployment: I will suggest check the Rasa webchat snippet code GitHub - botfront/rasa-webchat: A feature-rich chat widget for Rasa and Botfront, build a Wordpress website(using docker-> https://youtu.be/pYhLEV-sRpY) and install header and footer plugin in Wordpress, paste the snippet, change the socket url to “https:localhost:5005” and run you bot in live environment. Shell is fine but main idea and process you will learn with the real time deployment on website.

For Slot reset: Restart bot anytime - #11 by nbeuchat

Is that you got my points? Please read and if any doubt message. Happy learning!

first part:

I have a story that handles the mis understanding in the beginning, but my problem is that the user will go through the whole conversation (I will recognise entities and fill in slots) and then decides that, it wasn’t what he wanted so I have to delete what I have in my slots and start from scratch this is why once he “deny” at the last step of the form then I want to start again

for example in the form he said that he wants to pay his bill so I have the intention and the entity but then he decides to download his contract this is a whole new intention I want to get download instead of pay but the slot is already filled with the first intention and entity

I have a story with connect with live agent but I do so when the assistant can’t help anymore but in this case he changed his mind I just have a restart the process

second part : I will definitely have a look on how to deploy

the link to the restart bot anytime they are using MappingPolicy which is not used anymore and replaced by RulePolicy which I already use

@nik202 is it more clear or you want me to share a whole conversation and how it works ? Thanks again means a lot

@AminaDerouiche I hope this will help you, Validation:- https://www.youtube.com/watch?v=CKn4ZBh9PpY

You need to re-write the code as per your requirements. If all values are filled by the user then submit the form and show the details to the user, or if the user wants some other process to initiate it will trigger that. I hope it makes sense?

I think this is exactly what I need thanks @nik202