Want to create alexa skill such that alexa will ask 4-5 questions to user and user will responds after every answer and that will be stored in db?

huangapple go评论62阅读模式
英文:

Want to create alexa skill such that alexa will ask 4-5 questions to user and user will responds after every answer and that will be stored in db?

问题

Alexa会依次提出4-5个问题,用户将在每个回答后进行回应,而答案将存储在数据库中,这一切都要在Alexa技能的一个意图和Python代码中实现...

我尝试了一个意图,但用户回应后有时会触发新的意图,这不是我想要的... 我创建了一个QuestionIntent,其中问题将从API中获取,然后在触发Question意图后Alexa会首先提出第一个问题... 还创建了用于Question意图的自定义槽位以用于答案。

英文:

Alexa will ask 4-5 questions one after another user will respond after every answer and answer will be stored in db that all want in one intent of alexa skill and python code...

I tried one intent but after user respond sometimes new intent get triggered that i dont want... I create QuestionIntent in which question will fetch from API and then alexa will ask first question after triggering Question intent .. Also create custom slot for question intent with for answers

答案1

得分: 3

我了解您希望创建一个用于收集用户反馈的技能,涉及多个问题,而且用户的回答有时可能触发不希望的意图。我注意到您还提到用户的回答会有所不同,因此您不希望为自定义槽设置特定的值。

我建议您使用内置的槽类型AMAZON.SearchQuery。这种槽类型可以用来收集不太可预测的用户输入。然而,需要牢记的一点是,使用AMAZON.SearchQuery的意图的示例话语必须包括携带短语,例如“我的回答是 {feedback}”。只有一个简单的“{feedback}”示例话语是不起作用的。因此,建议您的技能在用户的反馈回应中引导用户使用这个携带短语。

在用于收集反馈的意图处理程序中,您可以让Alexa回应下一个问题。您可以使用会话属性来跟踪问题编号,并在最后一个问题回答后进行相应的回应。

英文:

I understand you are looking to create a skill which collects user feedback for multiple questions, and that user answers sometimes trigger an undesired intent. I see you also mentioned that user answers will differ, and therefore you don't want to set any specific values for a custom slot.

I would recommend you use the built-in slot type, AMAZON.SearchQuery. This slot type can be used to collect less-predictable user input. One important thing to keep in mind, however, is that sample utterances for an intent which uses AMAZON.SearchQuery must include carrier phrases, such as "my answer is {feedback}". A sample utterance of simply "{feedback}" will not work. Therefore, your skill would benefit from instructing your users to use this carrier phrase in their feedback responses.

Within your intent handler for collecting feedback, you can have Alexa respond with the next question. You can use session attributes to keep track of the question number, and reply accordingly after the final question is answered.

huangapple
  • 本文由 发表于 2023年2月24日 02:16:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75548790.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定