Condition contraints on a rule - what am I doing wrong?

Hi,

I am testing out some simple rules with conditions and struggling to get them to work.

In the example below, my slot “call_fallback” is either “None” or “yes”. However, regardless of what my slot is set to, whenever I hit the intent “show_slot”, it triggers the rule.

Should this rule not trigger if my slot is set to None i.e. the default value?

- rule: Show Slot
  condition: 
  - slot_was_set:
    - call_fallback: true
  steps:
  - intent: show_slot
  - action: utter_show_the_slot

My config simply has this line as a policy:

- name: RulePolicy

Thoughts?

Thanks Mark

@pomegran Hi, what is the type of call_fallback mentioned in domain.yml ? or is influence is set to true of false ?

Hi Nik,

I have made some progress.

I was not setting the slot’s “influence_conversation” flag (the documentation said this was the default so I didn’t put it in!). I have now changed this to “true” and this rule now triggers (my slot is type ‘text’ by the way:

- rule: Show Slot
  condition: 
  - slot_was_set:
    - call_fallback: 'yes'
  steps:
  - intent: show_slot
  - action: utter_show_the_slot

That’s good news, so thank you for the pointer!

However, this was a test to try and trigger an action during a form field validation. In my custom form field validation I set the “call_fallback” slot to ‘yes’ and try to trigger the action_default_fallback with this rule:

- rule: Call fallback
  condition: 
  - slot_was_set:
    - call_fallback: 'yes'
  steps:
  - action: action_default_fallback

However, it never triggers, I assume as I’m in a form with custom validation. I read this in the documentation but I’m not clear what it means:

To intentionally reject the form execution, you can also return an ActionExecutionRejected event as part of your custom validations or slot mappings.

I’m not sure that this means or even how I execute it considering a slot validation only allows me to return slot values (list of key value pairs).

Is that clear? :slight_smile:

Thanks Mark

@pomegran can you share config.yml and did you mention the utter_default in domain.yml ?

Hi Nik,

In summary, I am just trying to understand how I can exit a form slot if I am using custom validation i.e. how I call another action. To help demonstrate this I have a created a simple form (triggered by saying “start form”) that asks for text entry. The custom validation looks for the word “go” to proceed (obviously this is just for demonstration purposes). In this example, I can never leave the slot UNTIL I say “go” i.e. people can get stuck in the form unless they enter a valid input.

I have tried setting slots in the validation response to try and trigger another rule but they simply never trigger.

I have attached the files if you want to take a look?

Thanks Mark

config.yml (1.1 KB) domain.yml (549 Bytes) endpoints.yml (1.4 KB) nlu.yml (376 Bytes) rules.yml (325 Bytes) actions.py (902 Bytes)

@pomegran Sorry, for getting back to you late, as you not mentioned me so, I lost the message in unread.

Can you share some bot/user example so that I can dry run the code for you mark ? Please always mention @ and nik202.

@pomegran even update the stories file in above post.

@pomegran now, what?

Hi @nik202

Apologies for not seeing your message either!

If you take a look at the actions.py, I’ve commented in there. If I say anything else apart from go, how can I trigger the action_default_fallback action e.g. for the default fallback response?

I want to leverage features in my already existing action_default_fallback action to do things like count for repeated failures etc. Otherwise I am stuck in this slot until I say “go”, right?

Thanks for looking by the way. Any pointers appreciated.