Tell without terminating the session


#1

I am currently working on a voice app that requires me to skip speech generated by the SpeechBuilder. First, I was thinking I could chain multiple intents in a row but then I discovered that .tell always terminates the session and .ask always requires a response from the user. I feel like I am missing something.

How would I go about implementing an app with the following structure?

  • Welcome Message
  • First Time User Intro (On-device Text-to-Speech or MP3, skippable)
  • News Story 1 (On-device Text-to-Speech or MP3, skippable)
  • Transition (MP3 or Assistant Response)
  • News Story 2 (On-device Text-to-Speech or MP3, skippable)
  • Transition (MP3 or Assistant Response)
  • News Story X (On-device Text-to-Speech or MP3, skippable)
  • Transition (MP3 or Assistant Reponse)
  • Outro (On-device Text-to-Speech or MP3, skippable)

It comes down to the question: How do I get the app to say something and then go on with something else without requiring the user to respond and without it all being part of a single intent and state?

Thanks!


#2

If you really need the skippable option you can just implement an intent for skipping which should work on phones with no doubt (u could make use of google actions suggestions for the assistant). Then u could also implement a skip button for alexa and google assistant using the device specific Templates. At least thats the first solution that comes to my mind. But it doesnt sound to clever to make everything skippable. If your news Story is that long think about just telling the headline and ask the user if he wants to hear more. That makes more sense to me

Depending mulitple intents in a row: U can just simply use

return this.toIntent(‘IntentNameToNavigate’);

Let’s say u want to emit the Welcome Message and the First Time User Intro at the same time.
I would generate an operation that attaches the welcome msg, more precise the text that’ll be told by the TTS engine, in front of the stuff that will be said with the frist time user intro (string concatenation). Just get some brakes in between for example with ssml. Than check for some condition in the intent of the welcome message and navigate to the intent for the first time user intro where u call the operation to attach the welcome message.

Building voice apps is some more out of the box thinking as far as what I can tell :smiley:


#3

Yes, one more thing to add to @H1Gerd’s message (thanks for your help!):

We see it often that people try to chain several tell methods. We probably need to change something there to have less confusion. Open for suggestions!

What I usually do when chaining multiple intents in a row: I add elements to the speechbuilder and then do an intent redirect:

LAUNCH() {
    this.$speech.addText('This is your welcome message!');
    
    if(this.$user.isNew()) {
        this.$speech.addText('First Time User Intro');
    }

    return this.toIntent('NewsStoryIntent');

},

NewsStoryIntent() {
    this.$speech.addText('News Story 1');
    this.$speech.addText('Transition');
   // ...

   this.tell(this.$speech);
}

#4

Thank you so much for your replies @H1Gerd & @jan ! :pray: I am beginning to understand.

Yes, that is exactly what I was doing at first. Coming from Voiceflow it seemed the natural way to go. In the beginning I did not realize it would terminate the sessions.

I went that route but I failed to come up with a skip intent that would allow me to skip certain parts of the final output. Is that just not possible at the moment? Or am I getting a concept wrong?

Here is a quick flowchart of the voice app I want to build: https://whimsical.com/UPmSXVZtRq3DiqnhHZwqEk


#5

I’m not sure what you mean with skipping. Would you want the user to skip certain parts, or rather skip certain parts yourself depending on where in the logic you are?

For example, I did this with

if(this.$user.isNew()) {
        this.$speech.addText('First Time User Intro');
    }

If the user isn’t new, this part is skipped


#6

I am sorry for not making myself clear: The user should be able to skip a news story if they are not interested in it while it is already playing.


#7

For this, you would need to add a SkipIntent (or AMAZON.NextIntent), and use this.ask for the news story output. Users could then say something like “Alexa, skip” or “Alexa, next” to go to the next session.

You could store the current story in the user database, retrieve it in the SkipIntent, and then play the next one. You could also use states.

I think a good way to get started is our Adventure Game course:

https://www.jovo.tech/courses/project-2-adventure-game