gpt4 book ai didi

alexa - 在 Alexa 中获取相对时间

转载 作者:行者123 更新时间:2023-12-04 20:31:29 28 4
gpt4 key购买 nike

我正在尝试开发 Alexa 技能,我需要获取相对时间,例如:“ 5 分钟前 ”。

我为我的技能定义了一个时间段,它接受像 5 minutes 这样的时间, 6.30 am4 in the morning .但我无法接受像 5 minutes ago 这样的时间.我是 Alexa 的新手,有人可以帮我解决这个问题吗

{
"slots": [
{
"name": "time",
"type": "AMAZON.TIME"
}
],
"intent": "ReportTime"
}

最佳答案

您可以添加 {modifier}可以使用多个关键字的插槽,例如“以前”和“从现在开始”。然后, intent 可能具有类似于以下话语的内容:

{
"name": "TimeTest",
"samples": [
"what happened {time} {modifier}",
"what will happen {time} {modifier}"
],
"slots": [
{
"name": "time",
"type": "AMAZON.TIME",
"samples": []
},
{
"name": "modifier",
"type": "custom_time_modifier",
"samples": []
}
]
}

具有以下自定义修饰符类型:
"types": [
{
"name": "custom_time_modifier",
"values": [
{
"id": null,
"name": {
"value": "ago",
"synonyms": [
"in the past"
]
}
},
{
"id": null,
"name": {
"value": "from now",
"synonyms": [
"in the future"
]
}
}
]
}

关于alexa - 在 Alexa 中获取相对时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45157047/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com