How many text can conditional response take?

Hello, I’m trying to build a chatbot that can detect sentiment and give responses based on that. I found conditional response variations meet my requirements very well, and I set the condition in domain.yml like this:

utter_based_on_sentiment:
  - condition:
    - type: slot
      name: sentiment
      value: pos
    text: "Great, I'm very happy for you! 😄"

  - condition:
    - type: slot
      name: sentiment
      value: neg
    text: "Oh! Very sorry to hear that.

But when I try to add another text under pos condition to enhance the diversity of responses, I got this problem :

The configuration for policies was chosen automatically. It was written into the config file at 'config.yml'.
YamlSyntaxException: Failed to read '/Users/baoyue/Desktop/m2/emo_bot/domain.yml'. while constructing a mapping
  in "/Users/baoyue/Desktop/m2/emo_bot/domain.yml", line 71, column 5:
      - condition:
        ^ (line: 71)
found duplicate key "text" with value "Glad to hear it!" (original value: "Great, I'm very happy for you! 😄")
  in "/Users/baoyue/Desktop/m2/emo_bot/domain.yml", line 76, column 5:
        text: "Glad to hear it!"
        ^ (line: 76)

You can use https://yamlchecker.com/ to validate the YAML syntax of your file.

It seems conditional response variations can only take one text for a condition, what should I do?

I know it’s not practical, but it’s the solution:

utter_based_on_sentiment:
  - condition:
    - type: slot
      name: sentiment
      value: pos
    text: "Great, I'm very happy for you! 😄"

  - condition:
    - type: slot
      name: sentiment
      value: pos
    text: "Glad to hear it!"

  - condition:
    - type: slot
      name: sentiment
      value: neg
    text: "Oh! Very sorry to hear that.

@JenniferTanH Please check the indentation of your code and in last text you forgot to close the " " after that, please ref this doc link : Responses and yes, you can use another text, please check this doc example, how we can add -text:

utter_based_on_sentiment:
  - condition:
      - type: slot
        name: sentiment
        value: pos
    text: "Great, I'm very happy for you! 😄"

  - condition:
      - type: slot
        name: sentiment
        value: neg
    text: "Oh! Very sorry to hear that."

OR

  - condition:
      - type: slot
        name: sentiment
        value: neg
    text: "Oh! Very sorry to hear that."
  - text: " Aww, so sorry to hear that "

PS: If you are using bool slot, I would recommend to check the doc Responses

I wish this will solve your issue, good luck!

Sorry I missed the closing " when pasting the code. Thank you for your reply, but I think

- condition:
      - type: slot
        name: sentiment
        value: neg
    text: "Oh! Very sorry to hear that."
  - text: " Aww, so sorry to hear that "

the second text is for default use. What I want is for neg sentiment has more responses.

@JenniferTanH please confirm me that are you able to get the two responses? yes or no? and your code is working?

My code is working, but I can only get “Oh! Very sorry to hear that.”

@JenniferTanH nice, means one issue is done, now need multiple text? right can you tell me the significance of using multiple text?

Thanks, because I want my bot to be more human-like, since it can detect sentiment, it is very dummy to always give the same response. Do i need to use custom actions to do this?

@JenniferTanH doesn’t this work? Any feedback?

@ChrisRahme Your way works but as you mentioned it would become unpractical with lots of response options.

Is there any update on the subject or new way to achieve this?

Something like this would be great:

- condition:
      - type: slot
        name: sentiment
        value: neg
    text: 
    - "Oh! Very sorry to hear that."
    -  Aww, so sorry to hear that "