我是新来的alexa。我学会了并开始构建天气应用程序。在亚马逊给出一个字符串插槽alexa
现在我能得到的气象资料,但在以下条件下,
我craeated定制插槽(LIST_OF_CITIES)以如下举行城市。
{
"intents": [
{
"intent": "WeatherIntent",
"slots": [
{
"name": "city",
"type": "LIST_OF_CITIES"
}
]
},
{
"intent": "AMAZON.HelpIntent"
},
]
}
并在我给出的自定义插槽中,如下所示。
Type Values
LIST_OF_CITIES Hyderabad | pune | london
以下是我的话语
WeatherIntent give me {city} climate
WeatherIntent {city}
WeatherIntent what's the climate in {city}
WeatherIntent what's the weather in {city}
WeatherIntent {city}
当我运行使用任何在上表中提到的三个城市,我的计划,我能够得到正确的。如果我使用除上述之外的任何内容,它将返回值为-4。
如果我想获得某个其他城市的特权,我需要在该列表中添加该城市。
请让我知道我如何动态获取vaues,我的意思是取决于LIST_OF_CITIES,如果输入城市名称,它应该返回结果。
此外,我尝试添加类型为LITERAL和AMAZON.LITERAL。当我救了它,我得到的异常,因为
Error: There was a problem with your request: Unknown slot name '{city}'. Occurred in sample 'WeatherIntent get me weather of {city}' on line 1.
Please let me know where am I going wrong and how can I fix this.
感谢