0
votes

I have a custom skill which supports queries like Give me some information about <something>. And the response is a long text (about 5 sentences). I want to break this response into multiple alexa responses. How can this be done?

Clarification on what I mean by multiple parts. Currently it is like this.

Me: give me some information on Nutrino
Alexa: A neutrino is a fermion that interacts only via the weak subatomic force and gravity. The mass of the neutrino is much smaller than that of the other known elementary particles.....

What I want is,

Me: give me some information on Nutrino
Alexa: A neutrino is a fermion that interacts only via the weak subatomic force and gravity.
Alexa: The mass of the neutrino is much smaller than that of the other known elementary particles.....

I looked at Progressive Response but that involved much more complexities than required in this case I assume. Also, I looked at ssml, it does not have any such feature as well.

Note: I don't want a pause in the speech, which can be achieved by break tag, but two actual separate messages. The motivation behind this is, I want to ask a question like "Do you need more information" after my response and that should not be in the same message as the one that contains the information.

I am using this.emit functions of nodejs-sdk currently for responding.

2
Do you want a break between your sentences? is that what you are looking forjohndoe
Not just a pause which can be achieved by <break> tag, but two different messages altogether.Riken Shah
That's not possible. Can you give some more info about what you are trying to achieve, like when the next sentence has to be spoken.johndoe
Sure. I want to ask the question at the end of the response. But in a separate response. See my edit in the question for more clarity.Riken Shah
You cannot initiate a second response unless there is a request. What if you ask "Do you need more information" in re-prompt? will that fit your use case?johndoe

2 Answers

3
votes

We can send response only once from lambda to alexa. So please try designing your code in below mentioned way.

Me: give me some information on Nutrino
Alexa: A neutrino is a fermion that interacts only via the weak subatomic force and gravity. Do you need more information?
Me:  Yes
Alexa: The mass of the neutrino is much smaller than that of the other known elementary particles.....

As part of response we send use A neutrino is a fermion that interacts only via the weak subatomic force and gravity as prompt. Do you need more information? as reprompt. When user says Yes. Write a code in Yes Intent to answer your remaining statement The mass of the neutrino is much smaller than that of the other known elementary particles.

Hope this helps

1
votes

A skill's response can only contain a single output speech and a single reprompt. Both can be either a string or a SSML string. See here for details. You can not include multiple Alexa speeches in one response. You can also not send more than one response to a user's request. A user interaction with the skill is a cycle of single request and single response.

Edit: If you want to offer more information by asking: "Do you want more information" then your are actually prompting to the user which means you should expect the answers "yes" and "no". Only the next user input e.g. "yes" can trigger a new response from the skill.