Use case example
User invokes ProjectIntent
User: Can I create a project with company X
Alexa: Yes you can create a project with comapny X. If you have any questions you can contact us.
Alexa prompts: Would you like to call company X?
The user does not respond to this prompt and invokes another intent. The dialog of ProjectIntent is then an IN_PROGRESS state.
-Context Switch happens-
User invokes AnotherIntent
User: What is magento?
Alexa: Magento is blah blah.
But now, how do I get Alexa to prompt the user with (Would you like to call company X?) from the previous intent ProjectIntent.
I want Alexa to respond with: Magento is blah blah, Would you like to call company X?
I have been following this tutorial for context switching https://developer.amazon.com/blogs/alexa/post/114cec18-4a38-4cbe-8c6b-0fa6d8413f4f/build-for-context-switching-don-t-forget-important-information-when-switching-between-intents
I used a dialog state management interceptor to save the intent and slots to session attrbiutes.
Step 5 in the tutorial mentions:
We’re not out of the woods yet. We still need to tell the Alexa Service that we’ve changed the currentIntent’s slot values. To do so, we need to send our modified currentIntent along with the Dialog.Delegate that we pass back to the Alexa Service to have dialog management automatically prompt for our missing required slots. The SDK makes it easy for us. We simply need to pass currentIntent to the addDelegateDirective() function.
return handlerInput.responseBuilder.addDelegateDirective(currentIntent);
Where should this code be called? in an intent handler, response interceptor or a function?
This code will be able to prompt the user with - 'Would you like to call company X?'
The tutorial does not show an example of were this code is being used. Maybe im not understanding something here. Would appreciate some help and clarification.