buerokratt / Training-Module

MIT License
2 stars 20 forks source link

List all Rasa stories requiring specified slots, forms or responses #97

Open turnerrainer opened 1 year ago

turnerrainer commented 1 year ago

AS AN Architect I WANT to have a REST service to list all Rasa rules requiring specified slots SO THAT there wouldn't be duplicate services for it

Acceptance Criteria

Examples

Search for required slots

Slots are defined by defining slot_was_set, for example, rules.rule.steps.slot_was_set, rules.rule.condition.slot_was_set, etc.

version: "3.0"
stories:
- story: Deactivate custom fallback form
  steps:
  - action: custom_fallback_form
  - slot_was_set:
    - asukoht: Tallinn
  - action: action_react_to_affirm_deny_in_custom_fallback_form

or https://github.com/buerokratt/Training-Module/blob/main/mock1/data/stories.yml#L9-L14

Search for required forms

Forms are defined by defining action, for example, stories.story.steps.action with value(s) having a suffix _form

For example

version: "3.0"
stories:
- story: Deactivate custom fallback form
  steps:
  - action: custom_fallback_form
  - slot_was_set:
    - asukoht: Tallinn
  - action: action_react_to_affirm_deny_in_custom_fallback_form

or https://github.com/buerokratt/Training-Module/blob/main/mock1/data/stories.yml#L11

Forms are defined by defining active_loop, for example, stories.story.steps.active_loop with value(s) having a suffix _form

version: "3.0"
stories:
- story: User interrupts the form and doesn't want to continue
  steps:
  - intent: request_restaurant
  - action: restaurant_form
  - active_loop: restaurant_form

Search for required responses within stories

Responses are defined by defining action, for example, stories.story.steps.action with value(s) having a prefix utter_

For example

version: "3.0"
stories:
- story: andmekaitse_küsimused
  steps:
  - intent: andmekaitse_küsimused
  - action: utter_andmekaitse_küsimused

or https://github.com/buerokratt/Training-Module/blob/main/mock1/data/stories.yml#L7

janyprus commented 1 year ago

sample inputs to /rasa/stories/search

{
    "type": "slots",
    "slot": "asukoht"
}
{
    "type": "forms",
    "form": "custom_fallback_form"
}
{
    "type": "responses",
    "response": "utter_andmekaitse_küsimused"
}
turnerrainer commented 1 year ago

@janyprus please link this issue with an appropriate pull request.

janyprus commented 1 year ago

Pull requests #163 and #167

rasmusei commented 7 months ago

@turnerrainer will explain how to test it