如何在Alexa中以编程方式清除自定义插槽值? [英] How to clear custom slot value programmatically in Alexa?
本文介绍了如何在Alexa中以编程方式清除自定义插槽值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我具有Alexa技能,该技能要求以编程方式覆盖用户提供的值。
I have an Alexa skill which requires to programmatically override the values given by the user.
我尝试使该值无效,然后将其作为更新的Intent传递。
I have tried nullifying the value and later pass it in as the "updated Intent".
this.event.request.intent.userPrompt.value = null;
var updatedIntent = this.event.request.intent;
this.emit(':elicitSlot', 'userPrompt',"Say something","Say something", updatedIntent);
但是,输入JSON显示先前的值。有解决方案吗?
However, the input JSON shows previous value. Is there a solution to this?
推荐答案
有
delete this.event.request.intent.slots.<slotname>.value;
var updatedIntent = this event.request.intent;
this.emit(':elicitSlot', <slotname>,"Say something","Say something", updatedIntent);
如果您使用自定义广告位类型的广告位,也必须
if you have a slot with a custom slot type you also have to
delete this.event.request.intent.slots.<slotname>.resolutions;
这篇关于如何在Alexa中以编程方式清除自定义插槽值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文