Both ask()
and tell()
take their parameters and send back a response. The only difference is that ask()
keeps the conversation going, expecting the user to say something back, while tell()
indicates the conversation is over. If you think of this in terms of a web server, both ask()
and tell()
send back the equivalent of a page and then close the connection, but ask()
has included a form on the page, while tell()
has not.
Both of them can take a RichResponse object, which may include one or two strings or SimpleResponse objects which will be rendered as chat bubbles. You can't do three, however, at least not according to the documentation. So it sounds like your best bet will be to include one SimpleResponse
with the quote and attribution, and the second with the prompt for another.
This also sounds like a case where you want the audio to be different than the displayed text. In this case, you'd want to build the SimpleResponse
so it has both speech
fields and displayText
fields.
That might look something like this (tho I haven't tested the code):
var simpleResponse = {
speech: 'Steve Jobs said "Innovation is the only way to win."',
displayText: '"Innovation is the only way to win." -- Steve Jobs'
};
var richResponse = assistant.buildRichResponse();
richResponse.addSimpleResponse(simpleResponse);
richResponse.addSimpleResponse('Do you want another?');
assistant.ask( richResponse );
This will also let you do things like add cards in the middle of these two blurbs that could, for example, contain a picture of the person in question. To do this, you'd call the richResponse.addBasicCard()
method with a BasicCard
object. This might even be better visually than including the quote attribution on a second line.
As for design - keep in mind that you're designing for a wide range of devices. Trying to focus on the line formatting when you have display modes that are different (and sometimes non-existent) is of questionable design. Don't try to focus on what the conversation will look like, instead you should focus on how much the conversation feels like a conversation your user will have with another person. Remember that voice is the primary means of this conversation with visual intended to supplement that conversation, not rule it.