# How to get a bot to give different answers for two different people

**URL:** <https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824>\
**Category:** Rasa Open Source\
**Created:** [September 18, 2021, 4:41pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824 "2021-09-18T16:41:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 18, 2021, 4:41pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/1 "2021-09-18T16:41:37Z")

</div>

Hey @nik202

I have a situation:

My bot is going to talk to two different target audience:

1 - Doctors, and 2 - Non - doctors (or normal people.)

How do I build my bot that its able to answer the doctor with a more complex answer and the preson who is not a doctor with a simple answer?

Meaning there will be some way to choose if you are a doctor or not then get answered accordingly.

How can I do this?

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [September 18, 2021, 6:22pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/2 "2021-09-18T18:22:05Z")

</div>

When the bot first speaks, ask the user if they are a doctor or not using [buttons](https://rasa.com/docs/rasa/responses#buttons):

```auto
responses:
  utter_ask_if_doctor:
  - text: "Are you a doctor?"
    buttons:
    - title: Yes
      payload: /inform{{"doctor": true}}
    - title: No
      payload: /inform{{"doctor": false}}

```

Also

- Define the `inform` intent
- Define the `doctor` [slot](https://rasa.com/docs/rasa/domain#slots)
- Set its [type](https://rasa.com/docs/rasa/domain#boolean-slot) to `bool` and its [auto-fill](https://rasa.com/docs/rasa/domain#slot-auto-fill) to `true`

```auto
slots:
  doctor:
    type: bool
    auto_fill: true

```

- Create appropriate [stories](https://rasa.com/docs/rasa/stories) and/or [rules](https://rasa.com/docs/rasa/rules)

There are other ways to achieve that and make it better. Look at [forms](https://rasa.com/docs/rasa/forms).

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [September 19, 2021, 11:52am UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/3 "2021-09-19T11:52:04Z")

</div>

@atwine Check this demon use case for your reference and also you can follow Chris use case.

In **domain.yml**

```auto
intents:
 - doctor
 - non_doctor

responses:
 utter_menu:
    - text: For your consultation you can select from the below options:
      buttons:
        - title: Doctor Consultation
          payload: /doctor
        - title: Non-Doctor Consultation
          payload: /non_doctor

```

Create a story for the same or if you had written some action code for the same:

In **stories.yml**

For Doctor:

```auto
 - story: doctor consulation
    steps:
      - intent: doctor
      - action: action_doctor_consulation

```

For Non-Doctor:

```auto
 - story: non doctor consulation
    steps:
      - intent: non_doctor
      - action: action_non_doctor_consulation

```

OR

```auto
  - story: doctor
    steps:
      - intent: doctor
      - action: utter_doctor_consultation

  - story: non doctor
    steps:
      - intent: non_doctor
      - action: utter_non_doctor_consultation

```

**Note:** from above mention utterances you can mention any menu or question to be asked to user as shown in domain.yml

If you have any further doubts please, discuss and good luck!

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 19, 2021, 1:30pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/4 "2021-09-19T13:30:32Z")

</div>

@nik202

Thank you for that:

In my use case, i have faqs about a certain disease.

Am I right to say, I can set up the different faqs in two different yml files then later using rules I can choose which one gets answered?

Is that the right way of thinking?

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 19, 2021, 1:45pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/5 "2021-09-19T13:45:19Z")

</div>

Thank you, could you be having an already working solution, maybe a link to the code?

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [September 19, 2021, 1:49pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/6 "2021-09-19T13:49:25Z")

</div>

@atwine Yes, while using payload or custom action you can trigger the FAQs or any other question in two different buttons as shown

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 19, 2021, 1:51pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/7 "2021-09-19T13:51:24Z")

</div>

Thank you! Il do just that. Any sample project doing something like this? @nik202

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [September 19, 2021, 1:53pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/8 "2021-09-19T13:53:13Z")

</div>

@atwine These are the listed project on Rasa Github: [https://github.com/RasaHQ/rasa/tree/main/examples](https://github.com/RasaHQ/rasa/tree/main/examples) Hope this will help you.

@atwine I am not sure, that you fetching data from FAQs or from Excel/CSV or doing manual, if you can share more then I will try to give suggestions on that.

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 19, 2021, 1:58pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/9 "2021-09-19T13:58:09Z")

</div>

@nik202 I am getting the faq from a yml file: faq.yml.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [September 19, 2021, 2:02pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/10 "2021-09-19T14:02:41Z")

</div>

@atwine mean you manually doing that right? can you share faq.yml content?

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 19, 2021, 2:06pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/11 "2021-09-19T14:06:21Z")

</div>

```auto
intent: faq/what_is_hiv
examples: |
  - what's hiv
  - tell me about hiv
  - do you know about hiv

```

@nik202 that is what the faq yml contains just those intents.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [September 19, 2021, 2:08pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/12 "2021-09-19T14:08:04Z")

</div>

@atwine are you using chitchat or FAQs using response selector?

@atwine

```auto
  - story: doctor
    steps:
      - intent: faq1
      - action: utter_doctor_consultation

  - story: non doctor
    steps:
      - intent: faq2
      - action: utter_non_doctor_consultation

```

You just need to mention the response in utter\_doctor\_consultation or utter\_non\_doctor\_consultation

```auto
responses:
utter_doctor_consultation:
- text: "The Hive is the Human immunodeficiency virus infection and acquired immune deficiency syndrome"

utter_non_doctor_consultation:
-text: " faq2"

```

**Note:** I have just given you an idea, if you are using different intents, then for each intent you need to mention response in different utterances.

I hope it make sense to you now?

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 19, 2021, 2:09pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/13 "2021-09-19T14:09:43Z")

</div>

I am using response selctor. I have both chitchat and faqs in different yml files. @nik202

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [September 19, 2021, 2:13pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/14 "2021-09-19T14:13:53Z")

</div>

@atwine For your reference please check this link:

> **[rasa/examples/responseselectorbot at main · RasaHQ/rasa](https://github.com/RasaHQ/rasa/tree/main/examples/responseselectorbot)**
>
> main/examples/responseselectorbot

and try to follow it. Good Luck!

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 19, 2021, 2:32pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/15 "2021-09-19T14:32:36Z")

</div>

Thank you, this helps.

Btw, how do I close a thread, I have been looking for the option…can’t seem to find it. @nik202

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [September 19, 2021, 2:49pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/16 "2021-09-19T14:49:48Z")

</div>

@atwine it should have show you on the post next to it which mention solution.

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [September 19, 2021, 6:32pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/17 "2021-09-19T18:32:43Z")

</div>

Just want to mention that Nik’s solution only remembers the user is a doctor for one step, while if you use slots, it will remember that for the whole session - then you can set the reply according to this anytime you want using [custom actions](https://rasa.com/docs/rasa/custom-actions).

Just know there are these two options depending on your use case. 🙂

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 24, 2021, 8:14am UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/18 "2021-09-24T08:14:21Z")

</div>

I think you are right thanks.

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 24, 2021, 2:43pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/19 "2021-09-24T14:43:29Z")

</div>

Hello @ChrisRahme,

Please help me here, I am having this issue: my idea is this.

I have questions and answers for two types of people

### Doctors:

- the replies for these people are more complex

### NotDoctors

- the replies are simple and for normal people

I want to build the bot in such a way that it asks with two buttons, if you are a doctor then it shows the complex answers, if you are not a doctor, it shows simple faq answers.

This is how I have been trying to do below. Where could I be missing it.

when I run the bot I get the error below, its not picking the answers in the right way, it seems like its guessing or something.

# Error:

```auto
Bot loaded. Type a message and press enter (use '/stop' to exit): 
Your input -> hello                                                                                                                                     
Hello, how can I help you today?
? Hey! How are you? Are you a qualified Medical Personell? 1: Yes. (doctor{"doctor":true})                                                              
Your input -> what is covid?                                                                                                                            
2021-09-24 17:34:24 ERROR rasa.core.actions.action - Couldn't create message for response 'utter_notdoctor/what_is_covid'.
Your input -> how is it spread?                                                                                                                         
2021-09-24 17:34:33 ERROR rasa.core.actions.action - Couldn't create message for response 'utter_doctor/covid_spread'.
Your input ->   

```

## Rasa Version

```auto
(rasaenv) Drs-MacBook-Pro:Trial-Ground drjamesmugume$ rasa --version
Rasa Version : 2.8.1
Minimum Compatible Version: 2.8.0
Rasa SDK Version : 2.8.1
Rasa X Version : 0.39.3
Python Version : 3.7.5
Operating System : Darwin-19.6.0-x86_64-i386-64bit
Python Path : /opt/anaconda3/envs/rasaenv/bin/python
(rasaenv) Drs-MacBook-Pro:Trial-Ground drjamesmugume$ 

```

### NLU for Doctors

```auto
version: "2.0"
nlu:
- intent: doctor/what_is_covid
  examples: |
    - what is covid
    - what's corona
    - tell me about corona virus
    - corona?
    - covid-19?
    - define corona
    - what is covid19
- intent: doctor/covid_spread
  examples: |
    - how does it spread?
    - how does covid spread.
    - does it spread by air?
    - how can one contract it?
    - what means does it spread?
    - how do people get infected?
- intent: doctor/symptoms_covid
  examples: |
    - what are the symptoms?
    - symptoms of covid?
    - is temperature a symptom?
    - what are the signs of covid?
    - covid signs and symptoms
    - what should I look out for.
    - how do I know someone has covid?
- intent: doctor/covid_vaccine
  examples: |
    - what is the cure?
    - does it have a vaccine?
    - can it be vaccinated against?
    - what vaccine should I use for covid?

```

### NLU for non doctors

```auto
version: "2.0"
nlu:
- intent: notdoctor/what_is_covid
  examples: |
    - what is covid
    - what's corona
    - tell me about corona virus
    - corona?
    - covid-19?
    - define corona
    - what is covid19
    - what is covid?
- intent: notdoctor/covid_spread
  examples: |
    - how does it spread?
    - how does covid spread.
    - does it spread by air?
    - how can one contract it?
    - what means does it spread?
    - how do people get infected?
- intent: notdoctor/symptoms_covid
  examples: |
    - what are the symptoms?
    - symptoms of covid?
    - is temperature a symptom?
    - what are the signs of covid?
    - covid signs and symptoms
    - what should I look out for.
    - how do I know someone has covid?
- intent: notdoctor/covid_vaccine
  examples: |
    - what is the cure?
    - does it have a vaccine?
    - can it be vaccinated against?
    - what vaccine should I use for covid?

```

## Config

```auto
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en

pipeline:
# # No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.
# # If you'd like to customize it, uncomment and adjust the pipeline.
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
  - name: WhitespaceTokenizer
  - name: RegexFeaturizer
  - name: LexicalSyntacticFeaturizer
  - name: CountVectorsFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
    constrain_similarities: true
  - name: EntitySynonymMapper
  - name: ResponseSelector
    epochs: 100
    constrain_similarities: true
  - name: ResponseSelector
    epochs: 100
    retrieval_intent: doctor
    constrain_similarities: true
  - name: ResponseSelector
    epochs: 100
    retrieval_intent: notdoctor 
    constrain_similarities: true
  - name: FallbackClassifier
    threshold: 0.35
    ambiguity_threshold: 0.1

# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
# No configuration for policies was provided. The following default policies were used to train your model.
# If you'd like to customize them, uncomment and adjust the policies.
# See https://rasa.com/docs/rasa/policies for more information.
  - name: MemoizationPolicy
  - name: RulePolicy
  - name: UnexpecTEDIntentPolicy
    max_history: 8
    epochs: 100
  - name: TEDPolicy
    max_history: 5
    epochs: 100
    constrain_similarities: true

```

### Rules

```auto
version: "2.0"

rules:

- rule: Say goodbye anytime the user says goodbye
  steps:
  - intent: goodbye
  - action: utter_goodbye

- rule: Say 'I am a bot' anytime the user challenges
  steps:
  - intent: bot_challenge
  - action: utter_iamabot

- rule: ask doctor questions
  steps:
  - intent: doctor
  - action: utter_doctor

- rule: ask doctor questions
  steps:
  - intent: notdoctor
  - action: utter_notdoctor  

```

### Domain:

```auto
version: '2.0'
session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: false
intents:
- greet
- goodbye
- notdoctor:
    is_retrieval_intent: true
- doctor:
    is_retrieval_intent: true
- stop
- inform_doctor
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
entities:
- doctor
slots:
  doctor:
    type: bool
    influence_conversation: true
responses:
  utter_greet:
  - text: Hello, how can I help you today?
  utter_ask_if_doctor:
  - buttons:
    - payload: doctor{{"doctor":true}}
      title: Yes.
    - payload: notdoctor{{"doctor":false}}
      title: No.
    text: Hey! How are you? Are you a qualified Medical Personell?
  utter_cheer_up:
  - image: https://i.imgur.com/nGF1K8f.jpg
    text: 'Here is something to cheer you up:'
  utter_did_that_help:
  - text: Did that help you?
  utter_happy:
  - text: Great, carry on!
  utter_goodbye:
  - text: Bye
  utter_iamabot:
  - text: I am a bot, powered by Rasa.
  utter_doctor/what_is_covid:
  - condition:
    - type: slot
      name: doctor
      value: true
    text: This is the answer for the doctors.
  utter_doctor/covid_spread:
  - condition:
    - type: slot
      name: doctor
      value: true
    text: Covid_spred for doctors.
  utter_doctor/symptoms_covid:
  - condition:
    - type: slot
      name: doctor
      value: true
    text: symptoms_covid for doctors.
  utter_doctor/covid_vaccine:
  - condition:
    - type: slot
      name: doctor
      value: true
    text: covid_vaccine for doctors.
  utter_notdoctor/what_is_covid:
  - condition:
    - type: slot
      name: doctor
      value: false
    text: This is the answer for the not_doctors.
  utter_notdoctor/covid_spread:
  - condition:
    - type: slot
      name: doctor
      value: false
    text: Covid_spred for not_doctors.
  utter_notdoctor/symptoms_covid:
  - condition:
    - type: slot
      name: doctor
      value: false
    text: symptoms_covid for not_doctors.
  utter_notdoctor/covid_vaccine:
  - condition:
    - type: slot
      name: doctor
      value: false
    text: covid_vaccine for not_doctors.
actions:
- utter_ask_if_doctor
- utter_doctor
- utter_goodbye
- utter_greet
- utter_notdoctor

```

## Stories

```auto
version: "2.0"
stories:
- story: doctor path
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_ask_if_doctor
  - slot_was_set:
    - doctor: true
  - intent: doctor
  - action: utter_doctor 
  - intent: goodbye
  - action: utter_goodbye 

- story: not doctor path
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_ask_if_doctor
  - slot_was_set:
    - doctor: false
  - intent: notdoctor
  - action: utter_notdoctor
  - intent: goodbye
  - action: utter_goodbye

- story: interactive_story_1
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_ask_if_doctor
  - intent: doctor
    entities:
    - doctor: true
  - slot_was_set:
    - doctor: true
  - action: utter_doctor
  - intent: doctor
  - action: utter_doctor
  - intent: goodbye
  - action: utter_goodbye

- story: interactive_story_1
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_ask_if_doctor
  - intent: notdoctor
    entities:
    - doctor: false
  - slot_was_set:
    - doctor: false
  - action: utter_notdoctor
  - intent: notdoctor
  - action: utter_notdoctor
  - intent: notdoctor
  - action: utter_notdoctor
  - intent: goodbye
  - action: utter_goodbye

```

---

<div class="post-metadata">

**Author:** ![atwine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/atwine/32/16184_2.png) [@atwine](https://forum.rasa.com/u/atwine)\
**Post date:** [September 24, 2021, 2:43pm UTC](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824/20 "2021-09-24T14:43:55Z")

</div>

Hello @nik202 ,

Please help me here, I am having this issue: my idea is this.

I have questions and answers for two types of people

### Doctors:

- the replies for these people are more complex

### NotDoctors

- the replies are simple and for normal people

I want to build the bot in such a way that it asks with two buttons, if you are a doctor then it shows the complex answers, if you are not a doctor, it shows simple faq answers.

This is how I have been trying to do below. Where could I be missing it.

when I run the bot I get the error below, its not picking the answers in the right way, it seems like its guessing or something.

# Error:

```auto
Bot loaded. Type a message and press enter (use '/stop' to exit): 
Your input -> hello                                                                                                                                     
Hello, how can I help you today?
? Hey! How are you? Are you a qualified Medical Personell? 1: Yes. (doctor{"doctor":true})                                                              
Your input -> what is covid?                                                                                                                            
2021-09-24 17:34:24 ERROR rasa.core.actions.action - Couldn't create message for response 'utter_notdoctor/what_is_covid'.
Your input -> how is it spread?                                                                                                                         
2021-09-24 17:34:33 ERROR rasa.core.actions.action - Couldn't create message for response 'utter_doctor/covid_spread'.
Your input ->   

```

## Rasa Version

```auto
(rasaenv) Drs-MacBook-Pro:Trial-Ground drjamesmugume$ rasa --version
Rasa Version : 2.8.1
Minimum Compatible Version: 2.8.0
Rasa SDK Version : 2.8.1
Rasa X Version : 0.39.3
Python Version : 3.7.5
Operating System : Darwin-19.6.0-x86_64-i386-64bit
Python Path : /opt/anaconda3/envs/rasaenv/bin/python
(rasaenv) Drs-MacBook-Pro:Trial-Ground drjamesmugume$ 

```

### NLU for Doctors

```auto
version: "2.0"
nlu:
- intent: doctor/what_is_covid
  examples: |
    - what is covid
    - what's corona
    - tell me about corona virus
    - corona?
    - covid-19?
    - define corona
    - what is covid19
- intent: doctor/covid_spread
  examples: |
    - how does it spread?
    - how does covid spread.
    - does it spread by air?
    - how can one contract it?
    - what means does it spread?
    - how do people get infected?
- intent: doctor/symptoms_covid
  examples: |
    - what are the symptoms?
    - symptoms of covid?
    - is temperature a symptom?
    - what are the signs of covid?
    - covid signs and symptoms
    - what should I look out for.
    - how do I know someone has covid?
- intent: doctor/covid_vaccine
  examples: |
    - what is the cure?
    - does it have a vaccine?
    - can it be vaccinated against?
    - what vaccine should I use for covid?

```

### NLU for non doctors

```auto
version: "2.0"
nlu:
- intent: notdoctor/what_is_covid
  examples: |
    - what is covid
    - what's corona
    - tell me about corona virus
    - corona?
    - covid-19?
    - define corona
    - what is covid19
    - what is covid?
- intent: notdoctor/covid_spread
  examples: |
    - how does it spread?
    - how does covid spread.
    - does it spread by air?
    - how can one contract it?
    - what means does it spread?
    - how do people get infected?
- intent: notdoctor/symptoms_covid
  examples: |
    - what are the symptoms?
    - symptoms of covid?
    - is temperature a symptom?
    - what are the signs of covid?
    - covid signs and symptoms
    - what should I look out for.
    - how do I know someone has covid?
- intent: notdoctor/covid_vaccine
  examples: |
    - what is the cure?
    - does it have a vaccine?
    - can it be vaccinated against?
    - what vaccine should I use for covid?

```

## Config

```auto
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en

pipeline:
# # No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.
# # If you'd like to customize it, uncomment and adjust the pipeline.
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
  - name: WhitespaceTokenizer
  - name: RegexFeaturizer
  - name: LexicalSyntacticFeaturizer
  - name: CountVectorsFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
    constrain_similarities: true
  - name: EntitySynonymMapper
  - name: ResponseSelector
    epochs: 100
    constrain_similarities: true
  - name: ResponseSelector
    epochs: 100
    retrieval_intent: doctor
    constrain_similarities: true
  - name: ResponseSelector
    epochs: 100
    retrieval_intent: notdoctor 
    constrain_similarities: true
  - name: FallbackClassifier
    threshold: 0.35
    ambiguity_threshold: 0.1

# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
# No configuration for policies was provided. The following default policies were used to train your model.
# If you'd like to customize them, uncomment and adjust the policies.
# See https://rasa.com/docs/rasa/policies for more information.
  - name: MemoizationPolicy
  - name: RulePolicy
  - name: UnexpecTEDIntentPolicy
    max_history: 8
    epochs: 100
  - name: TEDPolicy
    max_history: 5
    epochs: 100
    constrain_similarities: true

```

### Rules

```auto
version: "2.0"

rules:

- rule: Say goodbye anytime the user says goodbye
  steps:
  - intent: goodbye
  - action: utter_goodbye

- rule: Say 'I am a bot' anytime the user challenges
  steps:
  - intent: bot_challenge
  - action: utter_iamabot

- rule: ask doctor questions
  steps:
  - intent: doctor
  - action: utter_doctor

- rule: ask doctor questions
  steps:
  - intent: notdoctor
  - action: utter_notdoctor  

```

### Domain:

```auto
version: '2.0'
session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: false
intents:
- greet
- goodbye
- notdoctor:
    is_retrieval_intent: true
- doctor:
    is_retrieval_intent: true
- stop
- inform_doctor
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
entities:
- doctor
slots:
  doctor:
    type: bool
    influence_conversation: true
responses:
  utter_greet:
  - text: Hello, how can I help you today?
  utter_ask_if_doctor:
  - buttons:
    - payload: doctor{{"doctor":true}}
      title: Yes.
    - payload: notdoctor{{"doctor":false}}
      title: No.
    text: Hey! How are you? Are you a qualified Medical Personell?
  utter_cheer_up:
  - image: https://i.imgur.com/nGF1K8f.jpg
    text: 'Here is something to cheer you up:'
  utter_did_that_help:
  - text: Did that help you?
  utter_happy:
  - text: Great, carry on!
  utter_goodbye:
  - text: Bye
  utter_iamabot:
  - text: I am a bot, powered by Rasa.
  utter_doctor/what_is_covid:
  - condition:
    - type: slot
      name: doctor
      value: true
    text: This is the answer for the doctors.
  utter_doctor/covid_spread:
  - condition:
    - type: slot
      name: doctor
      value: true
    text: Covid_spred for doctors.
  utter_doctor/symptoms_covid:
  - condition:
    - type: slot
      name: doctor
      value: true
    text: symptoms_covid for doctors.
  utter_doctor/covid_vaccine:
  - condition:
    - type: slot
      name: doctor
      value: true
    text: covid_vaccine for doctors.
  utter_notdoctor/what_is_covid:
  - condition:
    - type: slot
      name: doctor
      value: false
    text: This is the answer for the not_doctors.
  utter_notdoctor/covid_spread:
  - condition:
    - type: slot
      name: doctor
      value: false
    text: Covid_spred for not_doctors.
  utter_notdoctor/symptoms_covid:
  - condition:
    - type: slot
      name: doctor
      value: false
    text: symptoms_covid for not_doctors.
  utter_notdoctor/covid_vaccine:
  - condition:
    - type: slot
      name: doctor
      value: false
    text: covid_vaccine for not_doctors.
actions:
- utter_ask_if_doctor
- utter_doctor
- utter_goodbye
- utter_greet
- utter_notdoctor

```

## Stories

```auto
version: "2.0"
stories:
- story: doctor path
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_ask_if_doctor
  - slot_was_set:
    - doctor: true
  - intent: doctor
  - action: utter_doctor 
  - intent: goodbye
  - action: utter_goodbye 

- story: not doctor path
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_ask_if_doctor
  - slot_was_set:
    - doctor: false
  - intent: notdoctor
  - action: utter_notdoctor
  - intent: goodbye
  - action: utter_goodbye

- story: interactive_story_1
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_ask_if_doctor
  - intent: doctor
    entities:
    - doctor: true
  - slot_was_set:
    - doctor: true
  - action: utter_doctor
  - intent: doctor
  - action: utter_doctor
  - intent: goodbye
  - action: utter_goodbye

- story: interactive_story_1
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_ask_if_doctor
  - intent: notdoctor
    entities:
    - doctor: false
  - slot_was_set:
    - doctor: false
  - action: utter_notdoctor
  - intent: notdoctor
  - action: utter_notdoctor
  - intent: notdoctor
  - action: utter_notdoctor
  - intent: goodbye
  - action: utter_goodbye

```

[Next page](https://forum.rasa.com/t/how-to-get-a-bot-to-give-different-answers-for-two-different-people/47824.md?page=2)
