Can I make decisions based on slots?

Hi, I need to know why this doesn’t work and if it’s possible to do something like that

- story: story_1
  steps:
  - intent: greet
  - action: utter_greet
  - action: yes_no_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - slot_was_set:
    - yes_no: yes
  - action: utter_yes

- story: story_2
  steps:
  - intent: greet
  - action: utter_greet
  - action: yes_no_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - slot_was_set:
    - yes_no: no
  - action: utter_no

The yes_no_form has a form validation action that sets the yes_no slot. I have tested with influence_conversation true and false, but always it falls to action_default_fallback. What is wrong?

Thanks in advice.

Based on the provided YAML code, it seems like you are attempting to create two stories using the Rasa framework. The stories seem to involve the yes_no_form and actions related to it. The stories demonstrate different paths based on the yes_no slot value.

However, it’s important to note that the provided YAML code is missing some context, and it’s difficult to pinpoint the exact issue without seeing the complete configuration. There could be several reasons why your stories might not be working as expected. Here are a few things you can consider:

Form Action: Make sure that the yes_no_form is correctly defined in your domain and that the form validation action is set up properly to set the yes_no slot.

Slot Value: Double-check that the yes_no slot value is being set correctly by the form validation action. You can add debugging logs in your action code to verify the slot value.

Training Data: Ensure that you have provided enough training data for the greet intent, including variations that lead to a yes or no response in the yes_no form.

Fallback Policy: Check your fallback policy configuration. If Rasa is falling back to action_default_fallback, it might be due to low confidence scores in intent recognition or other factors. Adjusting the policy configuration might help.

Stories Order: The order of stories can matter. Make sure the order of the stories and corresponding intent/action definitions align with the desired flow.

Debugging: Run Rasa in debug mode (rasa shell --debug) to see the conversation flow and how slots are being set and used.

Custom Actions: Verify that your custom actions are functioning correctly, especially the and Myjdfaccount no actions.

If the issue persists after reviewing these points, providing more context or code snippets related to the form validation action, the slot, and the domain configuration would be helpful for a more accurate diagnosis. Additionally, checking the debug logs and Rasa’s responses during conversation can provide insights into what’s going wrong.

Haha ! Finally ChatGPT comes here into the Forum :slight_smile:

Back to your question: have you tried rules ?