Hello,
I tried to follow the demo restaurantbot and adept it to my needs, unfortunately i dont get the bot to save the value as an entry.
Here are some parts of my code:
nlu.md:
## intent:barcode
- 737628064502
- 524863975214
- 986325871589
- 985426785698
- 638526985478
- 362194875386
- 123123132
- 132123132132
- 12312312313
stories.md:
## start
* barcode
- barcode_form
- form{"name": "barcode_form"}
- form{"name": null}
- utter_slots_values
domain.yml:
intents:
- barcode
entities:
- barcode
slots:
barcode:
type: unfeaturized
templates:
utter_slots_values:
- text: 'I will look for the following barcode: {barcode}'
actions:
- utter_slots_values
forms:
- barcode_form
actions.py :
class GetBarcodeForm(Action):
def name(self) -> Text:
return "barcode_form"
@staticmethod
def required_slots(tracker):
return ["barcode"]
def slot_mappings(self):
return {
"barcode": [
self.from_entity(entity="barcode"),
self.from_text(intent="barcode"),
]
}
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
dispatcher.utter_template("utter_slots_values", tracker, barcode=987987987987)
return ["barcode"]
As you might have guessed, the bot recieves a barcode as my entry-message and should work with this barcode later (get fat,sugar, etc.).
My bot classifies a message like 123123123132
correctly as barcode-intent, but utter_slots_values
prints I will look for the following barcode: None
.
I would appreciate any help. Kind regards Andreas