Conditional Response in a button based chatbot

Hello,

I’m working on my first RASA project and I’ve got a small issue. I hope you can help me out.

I’m trying to make a button-based rasa chatbot, where users pick an option, and then the chatbot responds accordingly. The problem is, no matter what option I choose, I keep getting responses related to “sports.”

example 1: when choosing the Sports option (Screenshot-2023-11-24-182347 hosted at ImgBB — ImgBB)

example 2: when choosing movies option (Screenshot-2023-11-24-182237 hosted at ImgBB — ImgBB)

This is all the code needed.

stories.yml : stories.ym — Codefile

domain.yml: domain.yml — Codefile

nlu.yml: nlu.yml — Codefile

action.py: action.py — Codefile

I’m not sure where the issue is or how to fix it. Any help would be awesome.

Thank you in advance

Without knowing how you want the dialog to go, I can’t fully answer the question but I would start by removing the stories and using rules and a form. Read more about forms here. The form would prompt for the sport and subtopic slots.

I would also use conditional response variations instead of the action_provide_info.

version: '3.1'

rules:
  - rule: greet
    steps:
      - intent: greet
      - action: utter_greet

  - rule: Activate sports_form
    steps:
    - intent: choose_topic
    - action: sports_form
    - active_loop: sports_form

  - rule: Submit sports_form
    condition:
    - active_loop: sports_form
    steps:
    - action: sports_form
    - active_loop: null
    - slot_was_set:
      - requested_slot: null
    - action: action_provide_info

You could alternatively split that story up in to separate stories.

Thank you for your response, this is the dialog flow that i want to implement. I’m curious to understand why my approach may not be suitable for this particular case.

  • Long stories won’t scale and a single long story doesn’t work as you’ve discovered
    • When you create long stories, troubleshooting becomes more difficult and issues with conflicts in the stories are more likely
    • Stories increase training and inference times over rules

I have tried splitting the long story into smaller stories but it doesn’t solve the problem. Should i try using the rules and a form?