Rasa stories based on entity value

My nlu.yml file has an intent as the following:

- intent: 'issues_general'
  examples: |
      - I have an issue
      - I have a [prov]{"entity":"issue_type", "role":"prov_issues"} issue
      - I have a [technology]{"entity":"issue_type", "role":"tech_issues"} issue

And then in the stories.yml I have 3 different stories according to the value of the entity or the absence of an entity. If there is no entity, it goes to the no entity story. If there is an entity, it immediately goes to the tech entity only, even if the prov entity story was working prior to adding the tech entity.

You should use forms for this and shouldn’t be using role for the entity.

Could I possibly use categorical slots? with mappings as from entity?

This is how I mean: domain.yml entities: issue_type slots: issue_type: type: categorical values: - technology - access bundle influence_conversation: true mappings: - type: from_entity entity: issue_type nlu.yml

  • provision issues with [access bundle]{“entity”: “issue_type”}

stories.yml

  • story: story to handle issues with entity and role defined as provision_issues steps:
    • intent: issues_general
    • slot_was_set:
      • issue_type: access bundle
    • action: utter_faq_about_compliance/provision_issues

It seems to still not care about the slot value and only use either the general story or the most recently written categorical slot story. issue_type: access bundle seems to be redundant

To fix this, you can do this e.g.:

  • story: prov entity story steps:
    • intent: issues_general
    • slot_was_set:
      • entity: issue_type value: prov
    • action: prov_entity_action
  • story: tech entity story steps:
    • intent: issues_general
    • slot_was_set:
      • entity: issue_type value: technology
    • action: tech_entity_action
  • story: no entity story steps:
    • intent: issues_general
    • action: no_entity_action