Hi, This is my first rasa chat that i am trying.
What I want to achieve: after greetings, bot should receive incident number from user and store into mysql db. but for “- action_insertdb” all other actions are working as intended. I am not sure where the issue is. Seek you help to spot the issue.
nlu.md # intent:greet
- hey
- hello
- hi
- good morning
- good evening
- hey there
intent: request_incid
- I want to check my incident status
- incident status
- latest status of my incident
- let me know the status
- Updated incident status
- status of my incidentID
- Incident status
- want to know why my incident is not resolved yet?
intent: inform
- number is IC0001
- it is IC0002
- the numebr is IC0006
- the id is IC0009
- may be IC0034
- IC0002
- IC0009
- the incident number is IC000100
- the id is IC00010
- may be IC00012
- IC0002 is the number
- IC0001
- To my knowledge IC0003 is the incident ID
intent:affirm
- yes
- sure
- ok
- yeah
- alright
- ok sure
intent:goodbye
- bye
- goodbye
- see you around
- see you late
domain.py
intents: - greet - request_incid - inform - affirm - goodbye entities: - incid slots: incid: type: text actions: - utter_greet - utter_request_incid - utter_submit - utter_goodbye - action_incid - action_insertdb responses: utter_greet: - text: "Hey! How can I help you?" utter_request_incid: - text: "please provide your incident number" utter_submit: - text: "Thanks for contacting bot service" utter_goodbye: - text: "Bye" session_config: session_expiration_time: 60 carry_over_slots_to_new_session: true
action.py
> ## happy path
> * request_incid
> - utter_request_incid
> * inform{"incid":"IC0002"}
> - action_incid
> * affirm
> - **action_insertdb **
- utter_submit
Check_incident_details
say goodbye
Check_incident_details
- goodbye
- utter_goodbye
action.py
> from rasa_sdk.events import SlotSet
> from database_connectivity import DataUpdate
> from typing import Any, Text, Dict, List, Union, Optional
> from rasa_sdk import Action, Tracker
> from rasa_sdk.executor import CollectingDispatcher
> from database_connectivity import DataUpdate
>
> class ActionincidentID(Action):
> def name(self) -> Text:
> """Unique identifier of the form"""
> return "action_incid"
> def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
> incid=tracker.get_slot("incid")
> message="the incident number you entered is {}".format(incid)
> dispatcher.utter_message(text=message)
>
> class ActioninsertDB(Action):
> def name(self) -> Text:
> """Unique identifier of the form"""
> return "action_insertdb"
> def run(self, dispatcher: CollectingDispatcher,
> tracker: Tracker,
> domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
> DataUpdate(tracker.get_slot("incid"))
> dispatcher.utter_message(template="utter_submit")
> return []
log data in debug mode: the incident number you entered is IC0002303 Your input -> yes 2020-09-18 19:35:24 DEBUG rasa.core.tracker_store - Recreating tracker for id '1a870c896e4e4f66a1c5cfb3bc7fc0a3' 2020-09-18 19:35:24 DEBUG rasa.core.processor - Received user message 'yes' with intent '{'name': 'affirm', 'confidence': 0.9998311400413513}' and entities '[]' 2020-09-18 19:35:24 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 17 events. 2020-09-18 19:35:24 DEBUG rasa.core.policies.memoization - Current tracker state [{'prev_action_listen': 1.0, 'intent_request_incid': 1.0}, {'prev_utter_request_incid': 1.0, 'intent_request_incid': 1.0}, {'slot_incid_0': 1.0, 'intent_inform': 1.0, 'prev_action_listen': 1.0, 'entity_incid': 1.0}, {'slot_incid_0': 1.0, 'intent_inform': 1.0, 'prev_action_incid': 1.0, 'entity_incid': 1.0}, {'intent_affirm': 1.0, 'slot_incid_0': 1.0, 'prev_action_listen': 1.0}] 2020-09-18 19:35:24 DEBUG rasa.core.policies.memoization - There is a memorised next action 'action_insertdb' 2020-09-18 19:35:24 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_MemoizationPolicy 2020-09-18 19:35:24 DEBUG rasa.core.processor - Predicted next action 'action_insertdb' with confidence 1.00. 2020-09-18 19:35:24 DEBUG rasa.core.actions.action - Calling action endpoint to run action 'action_insertdb'. 2020-09-18 19:35:25 DEBUG rasa.core.processor - Action 'action_insertdb' ended with events '[BotUttered('Thanks for contacting bot service', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {}, 1600437925.4887807)]'. 2020-09-18 19:35:25 DEBUG rasa.core.processor - Current slot values: incid: IC0002303 2020-09-18 19:35:25 DEBUG rasa.core.policies.memoization - Current tracker state [{'prev_utter_request_incid': 1.0, 'intent_request_incid': 1.0}, {'slot_incid_0': 1.0, 'intent_inform': 1.0, 'prev_action_listen': 1.0, 'entity_incid': 1.0}, {'slot_incid_0': 1.0, 'intent_inform': 1.0, 'prev_action_incid': 1.0, 'entity_incid': 1.0}, {'intent_affirm': 1.0, 'slot_incid_0': 1.0, 'prev_action_listen': 1.0}, {'intent_affirm': 1.0, 'slot_incid_0': 1.0, 'prev_action_insertdb': 1.0}] 2020-09-18 19:35:25 DEBUG rasa.core.policies.memoization - There is a memorised next action 'utter_submit' 2020-09-18 19:35:25 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, 'affirm'. 2020-09-18 19:35:25 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_MemoizationPolicy 2020-09-18 19:35:25 DEBUG rasa.core.processor - Predicted next action 'utter_submit' with confidence 1.00. 2020-09-18 19:35:25 DEBUG rasa.core.processor - Action 'utter_submit' ended with events '[BotUttered('Thanks for contacting bot service', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {}, 1600437925.5067809)]'. 2020-09-18 19:35:25 DEBUG rasa.core.policies.memoization - Current tracker state [{'slot_incid_0': 1.0, 'intent_inform': 1.0, 'prev_action_listen': 1.0, 'entity_incid': 1.0}, {'slot_incid_0': 1.0, 'intent_inform': 1.0, 'prev_action_incid': 1.0, 'entity_incid': 1.0}, {'intent_affirm': 1.0, 'slot_incid_0': 1.0, 'prev_action_listen': 1.0}, {'intent_affirm': 1.0, 'slot_incid_0': 1.0, 'prev_action_insertdb': 1.0}, {'intent_affirm': 1.0, 'slot_incid_0': 1.0, 'prev_utter_submit': 1.0}] 2020-09-18 19:35:25 DEBUG rasa.core.policies.memoization - There is a memorised next action 'action_listen' 2020-09-18 19:35:25 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, 'affirm'. 2020-09-18 19:35:25 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_MemoizationPolicy 2020-09-18 19:35:25 DEBUG rasa.core.processor - Predicted next action 'action_listen' with confidence 1.00. 2020-09-18 19:35:25 DEBUG rasa.core.processor - Action 'action_listen' ended with events '[]'. 2020-09-18 19:35:25 DEBUG rasa.core.lock_store - Deleted lock for conversation '1a870c896e4e4f66a1c5cfb3bc7fc0a3'. Thanks for contacting bot service Thanks for contacting bot service Your input ->