I am trying to implement a functionality in my bot which sends a mail when a particular intent is hitted. Currently I can send the mail using Shell Script and Python Connection, but the mail is totally static, i.e. some predefined mail format with fixed Subject,Body.
Our intention is that when the particular mailing_intent is predicted, the user should get the feasibility of writing a free text which is independent of any intent prediction and that is captured using tracker.latest_message[‘text’] and can be used in the body of the mail.
Right now, we can pass the latest message of the mailing intent but I have no idea as how to fetch the free flow text which is independent of any intent prediction
Anyone can help me on this?
@akelad , I went through free text type, but couldn’t find it helpful in my case.
Please note: I am not using any
entities or slots, just normal intent hitting and then required to get a free flow text.
You can use Forms to get free text input. Although a form will fill a slot with the free text input, but I guess that should not be a problem (?)
You can trigger this form on receiving the mail intent, ask the user for free text, and then finally in the
submit() method of the form you can send the email.
Hope that helps.
@saurabh-m523, I get it what you’re trying to say!. But just one clarification I need is that the slot which will be captured has to be defined in nlu file. Without defining the slot, it won’t work. In that case, we have to fill up the slot values with some random data. But free text can go out of the section also.
Or is it possible that we do not define any intent with respect to that slot, and just mention it in domain.yml file and while defining the form, catch an undefined empty slot?
If you have any example regarding this, it would be helpful!!
No need to mention the slot in NLU. Actually NLU does not have slots at all, they are called entities. Slots can be of the same name as entities and are defined in
So, you can just define an
unfeaturized slot in the
domain.yml and then fill this slot in your FormAction.
Awesome. Loved the response. Will try it today and let everyone know about the same!
You want free text input right?
So you should use slot mappings. From the docs:
self.from_text(intent=intent_name) will use the next user utterance to fill the text slot
slot_name regardless of user intent if
None else only if user intent is
Hi @mishra-atul5001, did you get this working , i have the same problem and unable to find a solution. Please let me know if find a fix.