# Split utterances templates into multiple answers

**URL:** <https://forum.rasa.com/t/split-utterances-templates-into-multiple-answers/1204>\
**Category:** Rasa Open Source\
**Created:** [September 18, 2018, 4:38pm UTC](https://forum.rasa.com/t/split-utterances-templates-into-multiple-answers/1204 "2018-09-18T16:38:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcoka](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/marcoka/32/11989_2.png) [@marcoka](https://forum.rasa.com/u/marcoka)\
**Post date:** [September 18, 2018, 4:38pm UTC](https://forum.rasa.com/t/split-utterances-templates-into-multiple-answers/1204/1 "2018-09-18T16:38:41Z")

</div>

Hello there,

at the moment I’m starting to learn how to create dialogues with Rasa Core and one thing I couldn’t find in the documentation or anywhere else is how to define multiple agents answers. I don’t mean variations, I want to present answers in multiple speech bubbles to present the content in smaller bits.

Does anyone have an idea for that?

Best from Berlin, Marco 🙂

---

<div class="post-metadata">

**Author:** ![kothiyayogesh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/kothiyayogesh/32/324_2.png) [@kothiyayogesh](https://forum.rasa.com/u/kothiyayogesh)\
**Post date:** [September 18, 2018, 6:01pm UTC](https://forum.rasa.com/t/split-utterances-templates-into-multiple-answers/1204/2 "2018-09-18T18:01:09Z")

</div>

You can do something like,

In stories.md file,

> ## Story: smalltalk.greetings.hello
> 
> - smalltalk.greetings.hello
> - utter\_greetings.hello # Message : Hello
> - utter\_greetings.help # Message : How can I help you today?

In your custom action file,

```
def run (...)
    dispatcher.utter_message(response_1)
    dispatcher.utter_message(response_2)
    return [...]

```

---

<div class="post-metadata">

**Author:** ![marcoka](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/marcoka/32/11989_2.png) [@marcoka](https://forum.rasa.com/u/marcoka)\
**Post date:** [September 21, 2018, 7:52am UTC](https://forum.rasa.com/t/split-utterances-templates-into-multiple-answers/1204/3 "2018-09-21T07:52:44Z")

</div>

oh cool, thanks for the fast answer. I’ll try that later 🙂

---

<div class="post-metadata">

**Author:** ![smn-snkl](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/smn-snkl/32/902_2.png) [@smn-snkl](https://forum.rasa.com/u/smn-snkl)\
**Post date:** [September 26, 2018, 8:33am UTC](https://forum.rasa.com/t/split-utterances-templates-into-multiple-answers/1204/4 "2018-09-26T08:33:25Z")

</div>

You can also combine utterances of different types such as:

- greetings.hello

- utter\_greetings.hello
- action\_custom\_action

However, these messages will be pushed to the channel within miliseconds. So I tend to add some wait times. E.g. you could do this:

- greetings.hello

- utter\_greetings.hello
- action\_sleep
- action\_custom\_action

With action\_sleep looking something like:

```
    class ActionSleep(Action):
	    def name(self):
		    # type: () -> Text
		    return "action_sleep"

        def run(self, dispatcher, tracker, domain):
	        # type: (Dispatcher, DialogueStateTracker, Domain) -> List[Event]
	        time.sleep(3)		
	        return []

```

Not sure if there’s a better way though to make the bot pause in between multiple messages.

---

<div class="post-metadata">

**Author:** ![basque21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/basque21/32/1616_2.png) [@basque21](https://forum.rasa.com/u/basque21)\
**Post date:** [March 22, 2019, 10:57am UTC](https://forum.rasa.com/t/split-utterances-templates-into-multiple-answers/1204/5 "2019-03-22T10:57:17Z")

</div>

Hi, I’m receiving in the debug two answers from the Bot, but I don’t know how can I print both of them, because I’m getting only the first:

```auto
DEBUG:rasa_core.processor:Predicted next action 'utter_siniestro_auto' with prob 0.81.
DEBUG:rasa_core.processor:Action 'utter_siniestro_auto' ended with events '[]'
DEBUG:rasa_core.processor:Bot utterance 'BotUttered(text: le pasamos con siniestro de automóvil, data: {
  "elements": null,
  "buttons": null,
  "attachment": null
})'
DEBUG:rasa_core.policies.ensemble:Predicted next action using policy_0_KerasPolicy
DEBUG:rasa_core.processor:Predicted next action 'utter_init' with prob 0.94.
DEBUG:rasa_core.processor:Action 'utter_init' ended with events '[]'
DEBUG:rasa_core.processor:Bot utterance 'BotUttered(text: bienvenido a seguros, qué desea?, data: {
  "elements": null,
  "buttons": null,
  "attachment": null
})'

```

but then when I do:

```auto
    body = json.dumps({ "message": sentence, "uuid": "{}".format(user_id) })
    r = requests.post("http://localhost:5002/webhooks/botHttpServer/chat/Robbie/{}/ask".format(user_id), data=body)
    answer = json.loads(r.text)['response']
    slots = json.loads(r.text)
    print(answer)

```

I only get the first answer. Any help?

thanks

---

<div class="post-metadata">

**Author:** ![solyarisoftware](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/solyarisoftware/32/8464_2.png) [@solyarisoftware](https://forum.rasa.com/u/solyarisoftware)\
**Post date:** [April 25, 2020, 11:06am UTC](https://forum.rasa.com/t/split-utterances-templates-into-multiple-answers/1204/6 "2020-04-25T11:06:58Z")

</div>

Hi @kothiyayogesh,

to have a sequence of multiple answers, i just tested that’s sufficient to have a story that reply to an intent with a sequence of utterances, as you showed in your example.

But, apparently there is need to have a custom action. I’m wrong?

BTW, because this thread is old, there is better solution in RASA now?

Thanks giorgio
