al777
(Ueno)
December 17, 2021, 12:58pm
1
Hi, I’m trying to set a condition using values in rules but I’m having some trouble.
- rule: Caso feedback positivo agradece e finaliza
condition:
- type: slot
name: feedback_sentiment
value: "positive"
steps:
- action: action_submit_feedback_details
- action: utter_finish_feedback
YamlValidationException: Failed to validate 'data\rules\rules_feedback.yml'. Please make sure the file is correct and all mandatory parameters are specified. Here are the errors found dur
ing validation:
in data\rules\rules_feedback.yml:23:
Key 'type' was not defined. Path: '/rules/2/condition/0'
in data\rules\rules_feedback.yml:23:
Key 'name' was not defined. Path: '/rules/2/condition/0'
in data\rules\rules_feedback.yml:23:
Key 'value' was not defined. Path: '/rules/2/condition/0'
Where am I getting this wrong?
ChrisRahme
(Chris Rahmé)
December 17, 2021, 1:11pm
2
That’s not the correct format. Try this, as shown in the docs :
- rule: Caso feedback positivo agradece e finaliza
condition:
- slot_was_set:
- feedback_sentiment: "positive"
steps:
- action: action_submit_feedback_details
- action: utter_finish_feedback
1 Like
al777
(Ueno)
December 17, 2021, 1:39pm
3
Oh!
But what’s the difference from here?
responses:
utter_greet:
- condition:
- type: slot
name: is_new_user
value: true
text: "Thank you for signing up! What do you need help with?"
I get that one is a response and the other is a rule, is that it?
And thank you for your reply, I’m a little lost with the structure still.
al777
(Ueno)
December 17, 2021, 3:19pm
5
Chris, sorry to bother again .
Is there such a thing as multiple conditions (&& and ||) ?
Can I put a condition inside a condition?
Like, immediately after closing a form doing something if …?
And where can I find all conditions types?
Regards
ChrisRahme
(Chris Rahmé)
December 17, 2021, 10:34pm
6
For ||
, read about or statements :
condition:
- or:
- slot_was_set:
- name: Chris
- slot_was_set:
- name: Ueno
For &&
:
condition:
- slot_was_set:
- name: Chris
- slot_was_set:
- age: 23
Sorry I don’t really understand
It’s all in the docs
2 Likes
stritchi
(Harry)
April 2, 2022, 10:30am
7
Is this the && for conditions in particular working for rules to define dedicated paths?
rule:
condition:
slot_was_set:
slot_was_set:
slot_pathoption: phase2
steps:
intent: intention1
action: phase2
or
rule:
condition:
slot_was_set:
slot_was_set:
slot_pathoption: phase3
steps:
intent: intention1
action: phase3
ALSO it was not answered if OR statements work
rule:
condition:
or:
slot_was_set:
slot_was_set:
steps: