# Formbot Tutorial - New Cuisines Added to actions.py Not Entered in Database

**URL:** <https://forum.rasa.com/t/formbot-tutorial-new-cuisines-added-to-actions-py-not-entered-in-database/20665>\
**Category:** Rasa Open Source\
**Created:** [October 30, 2019, 6:58pm UTC](https://forum.rasa.com/t/formbot-tutorial-new-cuisines-added-to-actions-py-not-entered-in-database/20665 "2019-10-30T18:58:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![d7x](https://avatars.discourse-cdn.com/v4/letter/d/8baadc/32.png) [@d7x](https://forum.rasa.com/u/d7x)\
**Post date:** [October 30, 2019, 6:58pm UTC](https://forum.rasa.com/t/formbot-tutorial-new-cuisines-added-to-actions-py-not-entered-in-database/20665/1 "2019-10-30T18:58:14Z")

</div>

I’m running the formbot tutorial [https://blog.rasa.com/building-contextual-assistants-with-rasa-formaction](https://blog.rasa.com/building-contextual-assistants-with-rasa-formaction) and am getting the proper output for the code provided in the tutorial. I’m running with debug turned on.

However, when I make a simple update - adding 6 new cuisine names to actions.py - I get an error “rasa\_sdk.endpoint - Failed to extract slot cuisine with action restaurant\_form” or “sorry, I didn’t understand you, please try input something else” The first 2 names I added work fine but the last 4 generate errors.

I was careful to ensure that the proper spacing was used on the lines I added. Any ideas why these errors would result?

**New Code I added in actions.py** def cuisine\_db() -\> List[Text]: “”“Database of supported cuisines”""

```
    return [
        "caribbean",
        "chinese",
        "french",
        "greek",
        "indian",
        "italian",
        "mexican",
        "american",
        "thai",
        "bbq",
        "fast food",
        "pizza",
        "burgers",
    ]

```

**Debug output:** NOTE: the output below shows the error I get when I enter bbq. The second input below when thai is entered for cuisine shows that I was able to successfully add thai to the list of cuisines.

```
What type of food would you like?
Your input -> bbq                                                                                                                                                               
2019-10-30 15:45:53 DEBUG rasa.core.tracker_store - Recreating tracker for id 'default'
2019-10-30 15:45:53 WARNING root - Could not parse timestamp 0263b4c84e164caca9b49947313111e8. Instead current UTC time will be passed to duckling. Error: invalid literal for int() with base 10: '0263b4c84e164caca9b49947313111e8'
2019-10-30 15:45:53 DEBUG rasa.core.processor - Received user message 'bbq' with intent '{'name': 'request_restaurant', 'confidence': 0.7831459045410156}' and entities '[]'
2019-10-30 15:45:53 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 12 events
2019-10-30 15:45:53 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2019-10-30 15:45:53 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {'intent_greet': 1.0, 'prev_action_listen': 1.0}, {'prev_utter_greet': 1.0, 'intent_greet': 1.0}, {'prev_action_listen': 1.0, 'intent_request_restaurant': 1.0}]
2019-10-30 15:45:53 DEBUG rasa.core.policies.memoization - There is a memorised next action '14'
2019-10-30 15:45:53 DEBUG rasa.core.policies.form_policy - There is an active form 'restaurant_form'
2019-10-30 15:45:53 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_2_FormPolicy
2019-10-30 15:45:53 DEBUG rasa.core.processor - Predicted next action 'restaurant_form' with confidence 1.00.
2019-10-30 15:45:53 DEBUG rasa.core.actions.action - Calling action endpoint to run action 'restaurant_form'.
2019-10-30 15:45:53 ERROR rasa.core.actions.action - Failed to extract slot cuisine with action restaurant_form
2019-10-30 15:45:53 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2019-10-30 15:45:53 DEBUG rasa.core.policies.memoization - Current tracker state [{'intent_greet': 1.0, 'prev_action_listen': 1.0}, {'prev_utter_greet': 1.0, 'intent_greet': 1.0}, {'prev_action_listen': 1.0, 'intent_request_restaurant': 1.0}, {'intent_request_restaurant': 1.0, 'prev_restaurant_form': 1.0, 'active_form_restaurant_form': 1.0}, {'prev_action_listen': 1.0, 'intent_request_restaurant': 1.0, 'active_form_restaurant_form': 1.0}]
2019-10-30 15:45:53 DEBUG rasa.core.policies.memoization - There is no memorised next action
2019-10-30 15:45:53 DEBUG rasa.core.policies.form_policy - There is an active form 'restaurant_form'
2019-10-30 15:45:53 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_FallbackPolicy
2019-10-30 15:45:53 DEBUG rasa.core.processor - Predicted next action 'action_default_fallback' with confidence 0.30.
2019-10-30 15:45:53 DEBUG rasa.core.processor - Action 'action_default_fallback' ended with events '['BotUttered(text: sorry, I didn\'t understand you, please try input something else, data: {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, metadata: {})', 'UserUtteranceReverted()']'
2019-10-30 15:45:53 DEBUG rasa.core.processor - Current slot values: 
	cuisine: None
	feedback: None
	num_people: None
	outdoor_seating: None
	preferences: None
	requested_slot: cuisine
2019-10-30 15:45:53 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2019-10-30 15:45:53 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {'intent_greet': 1.0, 'prev_action_listen': 1.0}, {'prev_utter_greet': 1.0, 'intent_greet': 1.0}, {'prev_action_listen': 1.0, 'intent_request_restaurant': 1.0}]
2019-10-30 15:45:53 DEBUG rasa.core.policies.memoization - There is a memorised next action '14'
2019-10-30 15:45:53 DEBUG rasa.core.policies.form_policy - There is an active form 'restaurant_form'
2019-10-30 15:45:53 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, 'request_restaurant'.
2019-10-30 15:45:53 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_2_FormPolicy
2019-10-30 15:45:53 DEBUG rasa.core.processor - Predicted next action 'action_listen' with confidence 1.00.
2019-10-30 15:45:53 DEBUG rasa.core.processor - Action 'action_listen' ended with events '[]'
2019-10-30 15:45:53 DEBUG rasa.core.lock_store - Deleted lock for conversation 'default'.
sorry, I didn't understand you, please try input something else
Your input -> thai                                                                                                                                                              
2019-10-30 15:48:42 DEBUG rasa.core.tracker_store - Recreating tracker for id 'default'
2019-10-30 15:48:42 WARNING root - Could not parse timestamp d371caa548f84da599d40a8bb5779019. Instead current UTC time will be passed to duckling. Error: invalid literal for int() with base 10: 'd371caa548f84da599d40a8bb5779019'
2019-10-30 15:48:42 DEBUG rasa.core.processor - Received user message 'thai' with intent '{'name': 'inform', 'confidence': 0.7832643985748291}' and entities '[{'start': 0, 'end': 4, 'value': 'thai', 'entity': 'cuisine', 'confidence': 0.5489843690954916, 'extractor': 'CRFEntityExtractor'}]'
2019-10-30 15:48:42 DEBUG rasa.core.processor - Current slot values: 
	cuisine: None
	feedback: None
	num_people: None
	outdoor_seating: None
	preferences: None
	requested_slot: cuisine
2019-10-30 15:48:42 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 30 events
2019-10-30 15:48:42 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2019-10-30 15:48:42 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {'intent_greet': 1.0, 'prev_action_listen': 1.0}, {'prev_utter_greet': 1.0, 'intent_greet': 1.0}, {'prev_action_listen': 1.0, 'intent_request_restaurant': 1.0}]
2019-10-30 15:48:42 DEBUG rasa.core.policies.memoization - There is a memorised next action '14'
2019-10-30 15:48:42 DEBUG rasa.core.policies.form_policy - There is an active form 'restaurant_form'
2019-10-30 15:48:42 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_2_FormPolicy
2019-10-30 15:48:42 DEBUG rasa.core.processor - Predicted next action 'restaurant_form' with confidence 1.00.
2019-10-30 15:48:42 DEBUG rasa.core.actions.action - Calling action endpoint to run action 'restaurant_form'.
2019-10-30 15:48:42 DEBUG rasa.core.processor - Action 'restaurant_form' ended with events '['BotUttered(text: How many people are in your group?, data: {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, metadata: {"cuisine": "thai", "feedback": null, "num_people": null, "outdoor_seating": null, "preferences": null, "requested_slot": "cuisine"})', 'SlotSet(key: cuisine, value: thai)', 'SlotSet(key: requested_slot, value: num_people)']'
2019-10-30 15:48:42 DEBUG rasa.core.processor - Current slot values: 
	cuisine: thai
	feedback: None
	num_people: None
	outdoor_seating: None
	preferences: None
	requested_slot: num_people
2019-10-30 15:48:42 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.3).
2019-10-30 15:48:42 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {'intent_greet': 1.0, 'prev_action_listen': 1.0}, {'prev_utter_greet': 1.0, 'intent_greet': 1.0}, {'prev_action_listen': 1.0, 'intent_request_restaurant': 1.0}]
2019-10-30 15:48:42 DEBUG rasa.core.policies.memoization - There is a memorised next action '14'
2019-10-30 15:48:42 DEBUG rasa.core.policies.form_policy - There is an active form 'restaurant_form'
2019-10-30 15:48:42 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, 'inform'.
2019-10-30 15:48:42 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_2_FormPolicy
2019-10-30 15:48:42 DEBUG rasa.core.processor - Predicted next action 'action_listen' with confidence 1.00.
2019-10-30 15:48:42 DEBUG rasa.core.processor - Action 'action_listen' ended with events '[]'
2019-10-30 15:48:42 DEBUG rasa.core.lock_store - Deleted lock for conversation 'default'.
How many people are in your group?
```

---

<div class="post-metadata">

**Author:** ![Arjaan](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/arjaan/32/5754_2.png) [@Arjaan](https://forum.rasa.com/u/Arjaan)\
**Post date:** [October 30, 2019, 8:41pm UTC](https://forum.rasa.com/t/formbot-tutorial-new-cuisines-added-to-actions-py-not-entered-in-database/20665/2 "2019-10-30T20:41:02Z")

</div>

Hi @d7x Paul, what is going on is that the bot is not recognizing your answer ‘bbq’ as a possible message for the intent `inform` with an entity of cuisine. You must first teach the bot to understand that, and only then will it actually call the custom action to check if that type of cuisine is supported.

I recommend that you use [Rasa X](https://rasa.com/docs/rasa-x/), because you will detect these type of issues much easier.

For example, when you answer ‘italian’, Rasa X will show you that the bot correctly understands this as `inform{"cuisine":"italian"}`

![italian](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/3/3596aa96d666452de489ab64ad4ef7843bb71ebb.png)

This means that the bot correctly understand that your intent is inform, and the entity cuisine is italian.

Now, when you answer ‘bbq’, the bot does not understand that this is a sentence with intent `inform` and entity of type cuisine. It just shows `nul0`

![bbq-wrong](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/d/d5556f2e317427da1149fe48ffd41c5fa9d37e06.png)

In Rasa X , you can then also fix it easily by correcting the prediction for the sentence `bbq`. You just put your mouse next to it and select `correct this`:

![bbq-correct-this](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/a/ac24280b88afb0389d7f19d384bf86ae88815fb9.png)

Which opens up the `Interactive Learning` area where you can define that this sentence belongs to the intent `inform`:

 ![bbq-interactive-learning](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/6/65997d54bc2bd5ad512dcb6ed13648058c43b752.png)

Then you go to the NLU Training data section, where you can annotate `bbq` as entity of type cuisine:

 ![bbq-annotate-entity-cuisine](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/0/03328dfff2e8cf32c71b31f7cd59d475a64c0d7c.png)

Then retrain the model, make sure to make the new trained model the `active model` and try again. It will now work OK.

Let me know if this is all clear.

If you prefer to work without Rasa X, then you must manually edit the file `data/nlu.md`, by adding this:

```auto
## intent:inform
- [bbq](cuisine)

```
