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?
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
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 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.
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.
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
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?