The quick of it is that I’m trying to do validation on a slot and the value I’m expecting isn’t what is stored in the slot.
Using rasa shell
as my development UI, I display the values of my slots in a summary and you can see that the entire json object was stored in the slot after clicking a button.
Subject: /inform{"subject_level_one": "Accounts"}
My python validation is expecting “Accounts” as the value so it doesn’t trigger.
I can get this to validate if I change my if
statement to expect /inform{"subject_level_one": "Accounts"}
but that can’t be the proper way to do this, right?
My button code in my domain.yml
file looks like this:
utter_ask_subject_level_one:
- text: "Could you choose from the list what this about: [Subject Level 1]"
buttons:
- title: "Accounts"
payload: '/inform{"subject_level_one": "Accounts"}'
- title: "General"
payload: '/inform{"subject_level_one": "General"}'
- title: "System Functionality"
payload: '/inform{"subject_level_one": "System Functionality"}'
- title: "Training"
payload: '/inform{"subject_level_one": "Training"}'
To make this even more fun, in my validation code I added:
print (tracker.get_slot("subject_level_one"))
print (value)
And I see this in the action server console.
Accounts
/inform{"subject_level_one": "Accounts"}
Anyone have thoughts on why these are completely different?
The slot is correctly set, however in the utter_display summary
which I thought would contain the slot’s value in curly braces has the entire object.
That code looks like this (I trimmed it down, but you get the idea):
utter_display_summary:
- text: "Thank you. I will include the following information when I forward this to support. An email will be sent to {customer_email} shortly as well. \n
----------------------------------------\n
Subject: {subject_level_one}\n