0
votes

I am creating an Alexa skill, but it got rejected by Amazon. The way my skill works is as follows,

User: "alexa, ask doctor is it safe to use vaccine during pregnancy"

Alexa: "gives a response, fetched from DynamoDB" - (dialogState: Complete)

I got the following review comments from Amazon:

After the skill completes a task, the session remains open with no prompt to the user. The skill must close the session after fulfilling requests if it does not prompt the user for any input.

Can anyone help me with this?

I tried to use DelegateDialog but it doesn't seem to work.

handler_input.response_builder.add_directive(DelegateDirective())
                              .speak(message)
                              .ask(reprompt)
                              .set_card(SimpleCard("Custom", message))

I want Alexa to ask a question to the user, like "Do you have any other question?" So that the conversation doesn't end and keeps going. I don't want to close the session right after Alexa sends the answer.

1

1 Answers

1
votes

A couple of things:

delegate directive is when you want ASK(Alexa Skills Kit) to determine the next thing to speak. This only makes sense if you have a dialog model (requires slots, elicitation prompts, etc.) and the dialog is not yet completed. You do not seem to be using dialog model and at any case you are both delegating and providing speak() which I don't think is what you want.

For your scenario, you will likely want to produce a complete output that has both the answer and the next question. it can be as simple as string-append: message = db_response + ". Anything else?"