Beispiel #1
0
 def _is_rule_snippet_state(state: State) -> bool:
     prev_action_name = state.get(PREVIOUS_ACTION, {}).get(ACTION_NAME)
     return prev_action_name == RULE_SNIPPET_ACTION_NAME
Beispiel #2
0
 def _expected_but_missing_slots(fingerprint: Dict[Text, List[Text]],
                                 state: State) -> Set[Text]:
     expected_slots = set(fingerprint.get(SLOTS, {}))
     current_slots = set(state.get(SLOTS, {}).keys())
     # report all slots that are expected but aren't set in current slots
     return expected_slots.difference(current_slots)
Beispiel #3
0
 def _get_active_form_name(
     state: State, ) -> Optional[Union[Text, Tuple[Union[float, Text]]]]:
     return state.get(ACTIVE_LOOP, {}).get(LOOP_NAME)
Beispiel #4
0
 def _prev_action_listen_in_state(state: State) -> bool:
     prev_action_name = state.get(PREVIOUS_ACTION, {}).get(ACTION_NAME)
     return prev_action_name == ACTION_LISTEN_NAME
Beispiel #5
0
def _is_prev_action_unlikely_intent_in_state(state: State) -> bool:
    prev_action_name = state.get(PREVIOUS_ACTION, {}).get(ACTION_NAME)
    return prev_action_name == ACTION_UNLIKELY_INTENT_NAME