Stephen
Stephen

Reputation: 31

Alexa Skill Immediate Timeout

I'm creating an Alexa skill that is in essence a questionnaire. In the developer simulator on amazon's website, it works reasonably well without timeout. Following research, I've come to realize that there's a mandatory 8 second timeout approximately. I also see that in settings for the aws lambda function, one can change the timeout from a default of three seconds all the way up to five minutes, which I have done as part of my troubleshooting. However, this change seems to have had no effect.

My problem is as follows:

when testing on the alexa app or on echoism.io (I don't have an Alexa device but would imagine that these would behave similarly to it), the questions Alexa asks can only be answered if interrupted. In other words, suppose the question was finished being asked. Then, a beeping noise comes up to indicate that the user should respond. In this case, nothing happens and the skill exits even if user input is reasonable. However, if at any time during the prompt, the user hits the speak button and answers the question, interrupting the prompt, the answer will be correctly recorded as in the developer console simulation and as intended.

Any ideas of what could be causing this?

Request

{
       'version':'1.0',
       'session':{
          'new':False,
          'sessionId':'amzn1.echo-api.session.f55b0102-a3cb-4c1a-9b0c-6ef73f579c69',
          'application':{
             'applicationId':'amzn1.ask.skill.20852205-3919-4d6a-8a62-cb6f8c6214ef'
          },
          'user':{
             'userId':'amzn1.ask.account.AHVXIGHORW6PSATGYB6KWTZFBJ64Q2XXGRX3KFWWTRV7KLUAYSSR657SD74Z6E5PHXF35R75SZ7GJITERAT3XZ73LRXLR4KH2552NLMAL6WMAK2NQUZQ3EXB6DGOU2BZOTXFTT4UBBQSNNXB4J74U44UNWH6QJCWYBBATIIPE6YLV7W3TP4EYWQBTNTJ3LBVXF2EGFRDYRPTUCA'
          }
       },
       'context':{
          'System':{
             'application':{
                'applicationId':'amzn1.ask.skill.20852205-3919-4d6a-8a62-cb6f8c6214ef'
             },
             'user':{
                'userId':'amzn1.ask.account.AHVXIGHORW6PSATGYB6KWTZFBJ64Q2XXGRX3KFWWTRV7KLUAYSSR657SD74Z6E5PHXF35R75SZ7GJITERAT3XZ73LRXLR4KH2552NLMAL6WMAK2NQUZQ3EXB6DGOU2BZOTXFTT4UBBQSNNXB4J74U44UNWH6QJCWYBBATIIPE6YLV7W3TP4EYWQBTNTJ3LBVXF2EGFRDYRPTUCA'
             },
             'device':{
                'deviceId':'amzn1.ask.device.AHO5K5QILDUNW7BKDBJMLWENV7INXNFAHIAUB6ELHJ66MVMKQUPFT77GEEILVUDLABIN2JNUUQGPCOW2K6FX2EFTVKAZHGYFEFHZOLSZK5SHAQHLUK624DFPDS2FBBR6X4AZTKFLIJNLOCAWVQSLW5K2YJ5PGMGT2JBYXSNJE7GZWFIZC7WYK',
                'supportedInterfaces':{

                }
             },
             'apiEndpoint':'https://api.amazonalexa.com',
             'apiAccessToken':'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjEifQ.eyJhdWQiOiJodHRwczovL2FwaS5hbWF6b25hbGV4YS5jb20iLCJpc3MiOiJBbGV4YVNraWxsS2l0Iiwic3ViIjoiYW16bjEuYXNrLnNraWxsLjIwODUyMjA1LTM5MTktNGQ2YS04YTYyLWNiNmY4YzYyMTRlZiIsImV4cCI6MTUzMjk2OTc3NSwiaWF0IjoxNTMyOTY2MTc1LCJuYmYiOjE1MzI5NjYxNzUsInByaXZhdGVDbGFpbXMiOnsiY29uc2VudFRva2VuIjpudWxsLCJkZXZpY2VJZCI6ImFtem4xLmFzay5kZXZpY2UuQUhPNUs1UUlMRFVOVzdCS0RCSk1MV0VOVjdJTlhORkFISUFVQjZFTEhKNjZNVk1LUVVQRlQ3N0dFRUlMVlVETEFCSU4ySk5VVVFHUENPVzJLNkZYMkVGVFZLQVpIR1lGRUZIWk9MU1pLNVNIQVFITFVLNjI0REZQRFMyRkJCUjZYNEFaVEtGTElKTkxPQ0FXVlFTTFc1SzJZSjVQR01HVDJKQllYU05KRTdHWldGSVpDN1dZSyIsInVzZXJJZCI6ImFtem4xLmFzay5hY2NvdW50LkFIVlhJR0hPUlc2UFNBVEdZQjZLV1RaRkJKNjRRMlhYR1JYM0tGV1dUUlY3S0xVQVlTU1I2NTdTRDc0WjZFNVBIWEYzNVI3NVNaN0dKSVRFUkFUM1haNzNMUlhMUjRLSDI1NTJOTE1BTDZXTUFLMk5RVVpRM0VYQjZER09VMkJaT1RYRlRUNFVCQlFTTk5YQjRKNzRVNDRVTldINlFKQ1dZQkJBVElJUEU2WUxWN1czVFA0RVlXUUJUTlRKM0xCVlhGMkVHRlJEWVJQVFVDQSJ9fQ.CPFDpKzKMBq9Dyhlw7S_fIHTkxN2YODIg-T85YMRWMqHQbalCFd2nC1rqOXoIAX-T6TTkKiXpOSsvEBgnERKivzPgXTRFou3dxsXijSyr4-ip2Ouu5rk-9lQ0IfVtnD424Kbezq7UzlSeEqyvblaOw4Yd7JwbTD0EuPUtCaj_pwLZny3i5-NunFdy1ytmGPN3KTsIIBjkpal61Ao_xNGgEYq_t5lOIwtEfx8uzPIO3VXn78IVC37FOEgylX3sWljGoxDyG_dQ36sprXWIdHBU0SvFnYJYntNwFH4i59KB2G3XseIcjtKDT2oN2VGF-eBdeolQ9_V_qWxqgOooYhNHw'
          }
       },
       'request':{
          'type':'IntentRequest',
          'requestId':'amzn1.echo-api.request.848c8eed-7f47-4e32-a214-e034f03caf54',
          'timestamp':'2018-07-30T15:56:15Z',
          'locale':'en-US',
          'intent':{
             'name':'ScheduleCall',
             'confirmationStatus':'NONE',
             'slots':{
                'OMProductName':{
                   'name':'OMProductName',
                   'confirmationStatus':'NONE'
                },
                'DidSymtomsReAppear':{
                   'name':'DidSymtomsReAppear',
                   'confirmationStatus':'NONE'
                },
                'ProvideHCPContactInfo':{
                   'name':'ProvideHCPContactInfo',
                   'confirmationStatus':'NONE'
                },
                'PatientFirstName':{
                   'name':'PatientFirstName',
                   'confirmationStatus':'NONE'
                },
                'AskWhenEventBegun':{
                   'name':'AskWhenEventBegun',
                   'confirmationStatus':'NONE'
                },
                'DidHCPRecommendAnyTreatment':{
                   'name':'DidHCPRecommendAnyTreatment',
                   'confirmationStatus':'NONE'
                },
                'PNursing':{
                   'name':'PNursing',
                   'confirmationStatus':'NONE'
                },
                'PDueDate':{
                   'name':'PDueDate',
                   'confirmationStatus':'NONE'
                },
                'PlanToContinue':{
                   'name':'PlanToContinue',
                   'confirmationStatus':'NONE'
                },
                'HowOftenUseProduct':{
                   'name':'HowOftenUseProduct',
                   'confirmationStatus':'NONE'
                },
                'OMPDose':{
                   'name':'OMPDose',
                   'confirmationStatus':'NONE'
                },
                'DateOfMiscarriage':{
                   'name':'DateOfMiscarriage',
                   'confirmationStatus':'NONE'
                },
                'WhatDateWasPAdmitted':{
                   'name':'WhatDateWasPAdmitted',
                   'confirmationStatus':'NONE'
                },
                'AskIfFirstTime':{
                   'name':'AskIfFirstTime',
                   'confirmationStatus':'NONE'
                },
                'WhenStartUsingProduct':{
                   'name':'WhenStartUsingProduct',
                   'confirmationStatus':'NONE'
                },
                'PAnyMedicalConditions':{
                   'name':'PAnyMedicalConditions',
                   'confirmationStatus':'NONE'
                },
                'DrugNameSQ':{
                   'name':'DrugNameSQ',
                   'confirmationStatus':'NONE'
                },
                'DidPatientReUseProduct':{
                   'name':'DidPatientReUseProduct',
                   'confirmationStatus':'NONE'
                },
                'OtherMedications':{
                   'name':'OtherMedications',
                   'confirmationStatus':'NONE'
                },
                'AskPermission':{
                   'name':'AskPermission',
                   'confirmationStatus':'NONE'
                },
                'ReportedCauseOfDeath':{
                   'name':'ReportedCauseOfDeath',
                   'confirmationStatus':'NONE'
                },
                'OMPFreq':{
                   'name':'OMPFreq',
                   'confirmationStatus':'NONE'
                },
                'PatientInitials':{
                   'name':'PatientInitials',
                   'confirmationStatus':'NONE'
                },
                'PPregnant':{
                   'name':'PPregnant',
                   'confirmationStatus':'NONE'
                },
                'WasPAdmittedToHospital':{
                   'name':'WasPAdmittedToHospital',
                   'confirmationStatus':'NONE'
                },
                'AEMiscarriage':{
                   'name':'AEMiscarriage',
                   'confirmationStatus':'NONE'
                },
                'DidTreatSymptoms':{
                   'name':'DidTreatSymptoms',
                   'confirmationStatus':'NONE'
                },
                'DidPContactHCPAbtSymptoms':{
                   'name':'DidPContactHCPAbtSymptoms',
                   'confirmationStatus':'NONE'
                },
                'PatientsHeight':{
                   'name':'PatientsHeight',
                   'confirmationStatus':'NONE'
                },
                'PChildAE':{
                   'name':'PChildAE',
                   'confirmationStatus':'NONE'
                },
                'AEBirthDefect':{
                   'name':'AEBirthDefect',
                   'confirmationStatus':'NONE'
                },
                'OMPStartTaking':{
                   'name':'OMPStartTaking',
                   'confirmationStatus':'NONE'
                },
                'OMIsItTopical':{
                   'name':'OMIsItTopical',
                   'confirmationStatus':'NONE'
                },
                'IsPatientStillExperiencingSymptoms':{
                   'name':'IsPatientStillExperiencingSymptoms',
                   'confirmationStatus':'NONE'
                },
                'DrugReaction':{
                   'name':'DrugReaction',
                   'confirmationStatus':'NONE'
                },
                'AskLastTimeUsed':{
                   'name':'AskLastTimeUsed',
                   'confirmationStatus':'NONE'
                },
                'PAnyAllergies':{
                   'name':'PAnyAllergies',
                   'confirmationStatus':'NONE'
                },
                'DateOfDeath':{
                   'name':'DateOfDeath',
                   'confirmationStatus':'NONE'
                },
                'ReportedCauseBirthDefect':{
                   'name':'ReportedCauseBirthDefect',
                   'confirmationStatus':'NONE'
                },
                'DescPreviousPtSimilarExperience':{
                   'name':'DescPreviousPtSimilarExperience',
                   'confirmationStatus':'NONE'
                },
                'OMPReason':{
                   'name':'OMPReason',
                   'confirmationStatus':'NONE'
                },
                'AskPatientDrugQtyUse':{
                   'name':'AskPatientDrugQtyUse',
                   'confirmationStatus':'NONE'
                },
                'WhenDidSymptomsEnd':{
                   'name':'WhenDidSymptomsEnd',
                   'confirmationStatus':'NONE'
                },
                'DidYouGoToER':{
                   'name':'DidYouGoToER',
                   'confirmationStatus':'NONE'
                },
                'PatientWeight':{
                   'name':'PatientWeight',
                   'confirmationStatus':'NONE'
                },
                'ReportedCauseMisCarriage':{
                   'name':'ReportedCauseMisCarriage',
                   'confirmationStatus':'NONE'
                },
                'AgeOfPatient':{
                   'name':'AgeOfPatient',
                   'confirmationStatus':'NONE'
                },
                'WhyPUseProduct':{
                   'name':'WhyPUseProduct',
                   'confirmationStatus':'NONE'
                },
                'PhoneNumber':{
                   'name':'PhoneNumber',
                   'confirmationStatus':'NONE'
                },
                'OMPLastTimeUsed':{
                   'name':'OMPLastTimeUsed',
                   'confirmationStatus':'NONE'
                },
                'WhatDidERDoForP':{
                   'name':'WhatDidERDoForP',
                   'confirmationStatus':'NONE'
                },
                'NameOfHospital':{
                   'name':'NameOfHospital',
                   'confirmationStatus':'NONE'
                },
                'DidSymtomsImproveAfterStop':{
                   'name':'DidSymtomsImproveAfterStop',
                   'confirmationStatus':'NONE'
                },
                'AskAnyLabTest':{
                   'name':'AskAnyLabTest',
                   'confirmationStatus':'NONE'
                },
                'AECausedDeath':{
                   'name':'AECausedDeath',
                   'confirmationStatus':'NONE'
                }
             }
          },
          'dialogState':'STARTED'
       }
    }

Response

{
   'version':'1.0',
   'sessionAttributes':{

   },
   'response':{
      'outputSpeech':{
         'type':'PlainText',
         'text':'Thank you for using the Jane skill. See you next time!'
      },
      'card':{
         'type':'Simple',
         'title':'Jane - Thanks',
         'content':'Thank you for using the Jane skill. See you next time!'
      },
      'reprompt':{
         'outputSpeech':{
            'type':'PlainText',
            'text':None
         }
      },
      'shouldEndSession':True
   }
}

Upvotes: 3

Views: 2943

Answers (1)

johndoe
johndoe

Reputation: 4387

The default Alexa timeout is 8 seconds and it is not configurable. You can make use of reprompt to notify the user to answer. After the initial 8 seconds, reprompt will be triggered which gives the user another 8 more seconds to respond.

However, you can try some hacks like playing a silent audio for sometime in the background to extend this. But you will have to use the wake-up word "Alexa" in between to give a command or an answer.

And the Lambda time out is different, it is the maximum execution duration per request that comes to your Lambda function.

In the developer simulator on amazon's website, it works reasonably well without timeout.

A skill session within the Alexa Simulator tab does not time out the way a device would, to give you more time to enter your responses while testing. If your skill keeps the session open, you can close it with "stop."

shouldEndSession

This parameter in response JSON must be set to false if you want Alexa to start waiting for users response. You should set it to true when you actually want to end the session.

"shouldEndSession": true 

More on Response Object here

Upvotes: 3

Related Questions