I followed your suggestion. I revised my actions.py:
logger = logging.getLogger(__name__)
class BookingInfo(object):
def save(self, slot_topic):
logger.debug("-------slot_topic---------")
logger.debug(format(slot_topic))
logger.debug("-------slot_topic---------")
return
class ActionTopic(FormAction):
RANDOMIZE = False
@staticmethod
def required_fields():
return [
EntityFormField("slot_topic", "slot_topic")
]
def name(self):
return 'action_topic'
def submit(self, dispatcher, tracker, domain):
Bookinginfo = BookingInfo()
booking = Bookinginfo.save(tracker.latest_message.get("text"))
return[]
However, I type “cat” when asking the topic, it does not go into my slot though. (cat is not in my nlu_data.md)
On the action server side, it shows:
DEBUG:rasa_core_sdk.executor:Received request to run 'action_topic'
DEBUG:rasa_core_sdk.executor:Successfully ran 'action_topic'
On the bot terminal side, it shows:
What is your topic?
2018-10-02 19:44:40 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_1_MemoizationPolicy
2018-10-02 19:44:40 DEBUG rasa_core.processor - Predicted next action 'action_listen' with prob 1.00.
2018-10-02 19:44:40 DEBUG rasa_core.processor - Action 'action_listen' ended with events '[]'
127.0.0.1 - - [2018-10-02 19:44:40] "POST /webhooks/rest/webhook?stream=true&token= HTTP/1.1" 200 187 0.024927
cat
2018-10-02 19:44:42 DEBUG rasa_core.tracker_store - Recreating tracker for id 'default'
2018-10-02 19:44:42 DEBUG rasa_core.processor - Received user message 'cat' with intent '{'name': None, 'confidence': 0.0}' and entities '[]'
2018-10-02 19:44:42 DEBUG rasa_core.processor - Logged UserUtterance - tracker now has 14 events
2018-10-02 19:44:42 DEBUG rasa_core.processor - Current slot values:
requested_slot: None
slot_ThesisUpdate: None
slot_thesis: None
slot_topic: None
2018-10-02 19:44:42 DEBUG rasa_core.policies.memoization - Current tracker state [{'prev_action_listen': 1.0, 'intent_confirm_completion': 1.0}, {'intent_confirm_completion': 1.0, 'prev_utter_ask_topic': 1.0}, {'prev_action_listen': 1.0}]
2018-10-02 19:44:42 DEBUG rasa_core.policies.memoization - There is no memorised next action
2018-10-02 19:44:42 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_2_KerasPolicy
2018-10-02 19:44:42 DEBUG rasa_core.processor - Predicted next action 'action_topic' with prob 0.89.
2018-10-02 19:44:42 DEBUG rasa_core.actions.action - Calling action endpoint to run action 'action_topic'.
2018-10-02 19:44:42 DEBUG rasa_core.processor - Action 'action_topic' ended with events '['SlotSet(key: requested_slot, value: slot_topic)']'
2018-10-02 19:44:42 DEBUG rasa_core.policies.memoization - Current tracker state [{'intent_confirm_completion': 1.0, 'prev_utter_ask_topic': 1.0}, {'prev_action_listen': 1.0}, {'prev_action_topic': 1.0}]
2018-10-02 19:44:42 DEBUG rasa_core.policies.memoization - There is no memorised next action
2018-10-02 19:44:42 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_2_KerasPolicy
2018-10-02 19:44:42 DEBUG rasa_core.processor - Predicted next action 'utter_need_other_help' with prob 0.50.
2018-10-02 19:44:42 DEBUG rasa_core.processor - Action 'utter_need_other_help' ended with events '[]'
2018-10-02 19:44:42 DEBUG rasa_core.processor - Bot utterance 'BotUttered(text: Do you need any other help?, data: {
"elements": null,
"buttons": [
{
"payload": "Yes",
"title": "Yes"
},
{
"payload": "No",
"title": "No"
}
],
"attachment": null
})'
2018-10-02 19:44:42 DEBUG rasa_core.policies.memoization - Current tracker state [{'prev_action_listen': 1.0}, {'prev_action_topic': 1.0}, {'prev_utter_need_other_help': 1.0}]
2018-10-02 19:44:42 DEBUG rasa_core.policies.memoization - There is no memorised next action
However, if I type something in my training data, which is “dog behaviour”, it will get the slot value.
But from your suggestion is that whatever the user type, it will be the slot value, is it?