[Tutorial] How to Repeat Responses using the Jovo User Context Object


#1

Learn how to easily add a repeat functionality to your voice application using the Jovo User Context (available since Jovo v1.2).


This is a companion discussion topic for the original entry at https://www.jovo.tech/tutorials/repeat-responses-user-context

#2

Hi,

I did the same thing but don’t want repeat


#3

What happens? Any error messages?


#4

With google assistant the application leave and i don’t have any error


#5

The problem is when this.repeat() is called


#6

I solved the problem it was in my config.js


#7

What was the problem?


#8

It was missing user: { context: true, }


#9

It works on the JOVO webhook URL but when I deploy on aws lambda, it fails. Repeat doesn’t work


#10

You need to enable a database on AWS Lambda (like DynamoDb) to make it work.


#11

I’ve got context enabled in config.js. I use Firebase as db. Context works for Alexa, but when testing with Google Assistant I get error:

Message:
  Argument "data" is not a valid Document. Cannot use "undefined" as a Firestore value (found in field userData.context.prev.`0`.request.inputs.checkInDate.value).

  Stack:
  Error: Argument "data" is not a valid Document. Cannot use "undefined" as a Firestore value (found in field userData.context.prev.`0`.request.inputs.checkInDate.value).

I’m guessing jovo is trying to store undefined, which is not allowed. Any idea how to solve this problem?

PS. I solved it temporarily by setting some properties to false:

  user: {
    context: {
      enabled: true,
      prev: {
          size: 1,
          request: {
              intent: true,
              state: false,
              inputs: false,
              timestamp: true,
          },
          response: {
              speech: true,
              reprompt: true,
              state: true,
              output: true,
          },
      },
    },
  },

#12

I know it’s an old topic but it came back. I’m using Firestore and it seems like it can’t handle saving context when features like Cards or anything ISP related are in use. Is there a way to switch to session storage for context handling? I really need the ‘repeat’ intent functionality and this is a big problem.


#13

Fixed the code sample. This should work:

this.$alexaSkill.showStandardCard('Card Title', ' Card Content', {
        smallImageUrl: 'https://via.placeholder.com/720x480',
        largeImageUrl: 'https://via.placeholder.com/1200x800',
    })
    .tell('Hello World!');