Alexa Skill 自定义插槽 - 货币

Alexa Skill Custom slots - Currency

创建了自定义插槽类型 CURRENCIES 具有值

USD
JPY
CNY
SGD
HKD
CAD
NZD
AUD
CLP
GBP
DKK
SEK
ISK
CHF
BRL
EUR
RUB
PLN
THB
KRW
TWD

已成功测试价值 INR、GBP、EUR。

However during Certification got feedback

When attempting to invoke the skill using an example present in the example phrases or the skill’s description, the skill returns a non- contextualized response or error. All customer facing example phrases must function without error since these are interactions that users are most likely to try.

Steps To Reproduce: [Second Example Phrase]

User: "Alexa, ask XXX to convert bitcoin to i n. r."

Skill: "I didn't quite get that. Please provide currency to get bitcoin value?"

Please see test case 3.1 from our Submission Checklist for guidance on example phrases.

当我 运行 测试用例 i n. r. 它失败了。

如何映射我。河与印度卢比?认证报告 g b 中给出了类似的例子。河, 欧盟。 r.

这是我解决这个问题的方法。还有其他解决方案吗?

var tmp= this.event.request.intent.slots.CURRENCY_TO.value;
     if(tmp){
        var curr= tmp.toUpperCase().replace(/[\W_]/g, "");

自定义插槽验证需要在代码中处理。 参考 - https://developer.amazon.com/docs/custom-skills/handle-requests-sent-by-alexa.html#input-errors