I am struggling to instruct Alexa inside the onIntent method (java 8) to initiate a new intent which uses slots in dialog model.
This is my code
(1) Intent newIntent = Intent.builder().withName(origIntent.getName()) .withSlots(Common.returnSlotsWithNoValues(origIntent)) .withConfirmationStatus(ConfirmationStatus.NONE).build(); (2) IntentRequest ir = IntentRequest.builder().withRequestId("abcdefghijklmnopqrstuvwxyz") .withIntent(newIntent).withDialogState(DialogState.STARTED).withLocale(request.getLocale()).build(); (3) SpeechletRequestEnvelope env = SpeechletRequestEnvelope.builder().withSession(session) .withRequest(ir).withContext(requestEnvelope.getContext()) .withVersion(requestEnvelope.getVersion()).build(); (4) return this.onIntent(env);
(1): I am building a new Intent with a default setting of all slot values (tried also without doing so, and doesn't work either)
(2): building a new IntentRequest with a new dummy request id
(3): builidng the SpeechletRequestEnvelope
(4): sending this to the onIntent function of my SpeechletV2 skill speechlet
Alexa only says that something has gone wrong, but does not provide any more details to me.
What I am doing wrong here? Anything I can try out?
What is worth mentioning is that I follow the code above using an intent without any slots, then the code works. To me the issue is related to intents that use slots and dialog model.
Any help is very welcome!