I’m trying to make a skill that requires the user to login in order to pull their data from a separate database. For this, I need the user’s email. Initially, I had it so the skill’s LaunchRequestHandler would welcome the user and then immediately use elicit_slot_directive to forward them into a separate CaptureEmailIntent. Instead, I keep getting the following error:
"error": {
"type": "INVALID_RESPONSE",
"message": "The following directives are not supported: Dialog.ElicitSlot"
}
When browsing stack overflow for someone with a similar problem, all I could find was this. It seems their issue was specifically in the case of in skill purchase, so it’s not quite the same. My code is as follows:
class LaunchRequestHandler(AbstractRequestHandler):
"""Handler que lida com o lançamento da skill caso o usuário nunca tenha logado."""
def can_handle(self, handler_input: HandlerInput) -> bool:
return ask_utils.is_request_type("LaunchRequest")(handler_input)
def handle(self, handler_input: HandlerInput) -> Response:
speak_output = (
"Olá! Bem vindo ao Conecta Car. Antes de começar, precisarei que me diga o email vinculado à sua conta."
+ " Caso não possua uma conta, por favor, crie uma no aplicativo Conecta Car e tente novamente."
)
reprompt_text = "Por favor, me diga o email vinculado à sua conta."
return (
handler_input.response_builder.add_directive(
elicit_slot_directive.ElicitSlotDirective(
updated_intent=Intent(name="CaptureEmailIntent"),
slot_to_elicit="email",
)
)
.speak(speak_output)
.ask(reprompt_text)
.response
)
Thiago Rodrigues is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.