Testing chitchat and FAQs

Is it possible to write test stories for chit chat and FAQs? Test should look something like that?

- story: Ask name
  steps:
  - user: |
      What is your name?
    intent: simple_question/ask_name
  - action: utter_simple_question/ask_name

I did that, but when I run test, it didn’t pass. The failed_test_stories.yml output:

- story: Ask name (.\tests\test.yml)
  steps:
  - intent: simple_question
  - action: utter_simple_question/ask_name  # predicted: utter_simple_question
  - action: action_listen  # predicted: action_default_fallback

@ivan.dmi Heya!

I guess you have seen this doc page : Chitchat and FAQs please see how the rules are mentioned or you want to use stories only? Emphasis more on intent and the way chitchat is used in the doc.

@ivan.dmi Even please share the config.yml file .

Check:

  • story: ask name steps:
    • intent: ask_name or intent you defined in NLU simple_question/ask_name ?
    • action: utter_simple_question

Is it possible to use rules in tests? On this page (Testing Your Assistant) I don’t see examples with keyword rule in tests.This is from test.yml:

- story: Ask name
  steps:
  - user: |
      What is your name?
    intent: simple_question/ask_name
  - action: utter_simple_question/ask_name

@ivan.dmi mate I never tried it but you can experiment :slight_smile:

By running rasa test you can see, that both our tests still pass! Rules, however do not generalize to unseen conversations. You should reserve them for single-turn conversation snippets , and use stories to train on multi-turn conversations. More on this in the documentation.

You mean rules don’t need to be tested? How can I test FAQ and chit chat rule? I have rule in rules.yml:

- rule: simple question
  steps:
  - intent: simple_question
  - action: utter_simple_question

I have test:

- story: Ask name
  steps:
  - user: |
      What is your name?
    intent: simple_question/ask_name
  - action: utter_simple_question/ask_name

But It failed. Result from failed_test_stories.yml:

- story: Ask name (.\tests\test.yml)
  steps:
  - intent: simple_question
  - action: utter_simple_question/ask_name  # predicted: utter_simple_question
  - action: action_listen  # predicted: action_default_fallback

@ivan.dmi please try and please see my above post.

@ivan.dmi Please check this Github Repo: https://github.com/RasaHQ/rasa/tree/main/examples/responseselectorbot for your reference, you will get a lot of idea and syntax.

I don’t see tests there for chit chat and FAQs (https://github.com/RasaHQ/rasa/tree/main/examples/responseselectorbot).

@ivan.dmi Ivan, as a reference I shared you the repo, that dnt have any test or other information. Its complete project for FAQs and Chitchat. Now you got it?

Ok