rohitiec
(Rohit)
February 26, 2020, 6:41am
1
Hi All,
I have two intents as below, i have created forms for both
intent: see_logs
i don’t see my logs
i am not abe to see my SNAP logs
how do i see my SNAP logs
SNAP
intent: migration_issues
facing issues during migration
facing issues during migration SNAP logs
SNAP
But when i run the form for the first intent and give the slot as SNAP when asked by the bot, it identifies it as the second intent. and it fails in between of the form. can anyone please help.
Can anyone help me fix this?
Hi @rohitiec !
Can you please post you stories and the FormAction code?
rohitiec
(Rohit)
February 27, 2020, 6:40am
3
rohitiec:
migration_issues
The stories for both are following
see logs story 1
see_logs
see_logs_form
form{“name”:“see_logs_form”}
form{“name”:null}
action_restart
see logs story 2
see_logs{“application_name”: “SNAP”}
see_logs_form
form{“name”: “see_logs_form”}
form{“name”: null}
action_restart
migration form 1
migration_issues
migration_issues_form
form{“name”: “migration_issues_form”}
form{“name”: null}
action_restart
migration form 2
general_greet
migration_issues
migration_issues_form
form{“name”: “migration_issues_form”}
form{“name”: null}
action_restart
general_helpful_info
utter_general_helpful_info
rohitiec
(Rohit)
February 27, 2020, 7:36am
4
The form code for 1 use case is following, other form is also similar to this
class MigrationIssuesForm(FormAction):
def name(self) -> Text:
return “migration_issues_form”
@staticmethod
def required_slots(tracker: Tracker) -> List[Text]:
return ["application_name"]
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
return {
"application_name": [self.from_entity(entity="application_name"), self.from_text()],
}
def validate_application_name(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
"""Validate application name"""
if value.lower() in self.application_name_list():
return {"application_name": value}
else:
dispatcher.utter_template("utter_wrong_application_name", tracker)
return {"application_name": None}
@staticmethod
def application_name_list() -> List[Text]:
return [
"SNAP",
"KSNAP",
"LSNAP",
"MSNAP",
]
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
given_application_name=tracker.get_slot("application_name").lower()
if given_application_name == 'snap':
dispatcher.utter_template("utter_facing_issue_during_snap_migation",tracker)
return [SlotSet("application_name",given_application_name)]