gpt4 book ai didi

Alexa - 包罗万象

转载 作者:行者123 更新时间:2023-12-04 13:56:43 25 4
gpt4 key购买 nike

我有一个连接到后端和 DialogFlow/ApiAI 的聊天机器人。
我正在尝试在 Alexa 中设置一项技能,以便我可以捕捉到对我的技能所说的所有内容,然后将其转发到我的后端,以便我可以使用我现有的基础设施和 convo 设计。

我一直在努力与 Alexa 建立一个 intent 来捕捉一切并转发它。
据我了解,您应该使用 AMAZON.SearchQuery,但是当我尝试设置 intent 时出现以下错误:

构建失败
intent “CATCH_ALL”中的示例话语“CATCH_ALL {any}”必须包含载体短语。具有短语类型的示例 intent 话语不能仅由槽组成。错误代码:MissingCarrierPhraseWithPhraseSlot -

intent configuration

有谁知道怎么做?我也尝试使用 AMAZON.Literal,但它似乎已被弃用,而且我在使用它时无法建立技能。
我有点卡住了。如果有人有解决方案,那就太好了...

谢谢。

最佳答案

我终于通过做这样的事情来做到这一点:

    {
"interactionModel": {
"languageModel": {
"invocationName": "test",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "CATCHALL",
"slots": [
{
"name": "any",
"type": "AMAZON.LITERAL"
}
],
"samples": [
"{hey|any}",
"{hey hey|any}",
"{hey hey hey|any}",
"{hey hey hey hey|any}",
"{hey hey hey hey hey|any}"
]
}
],
"types": []
}
}
}

intent CATCHALL 的样本指示您要捕获的单词数。所以lige this,我会捕获一个和这5个单词之间的任何句子。

不过,我不确定当我提交应用程序时这是否会成为问题。

请注意,除了英语(美国)之外的任何语言都不支持 AMAZON.LITERAL,因此这对我来说不是解决方案,因为它是一个法语和英语聊天机器人。所以我又回到了开始......

编辑:这是没有文字的解决方案:
{
"interactionModel": {
"languageModel": {
"invocationName": "mon invocation",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": [
"que puis-je faire"
]
},
{
"name": "AMAZON.StopIntent",
"samples": [
"je veux quitter"
]
},
{
"name": "CATCH_ALL",
"slots": [
{
"name": "any",
"type": "ANYTHING"
}
],
"samples": [
"{any}"
]
}
],
"types": [
{
"name": "ANYTHING",
"values": [
{
"name": {
"value": "hey"
}
},
{
"name": {
"value": "hey hey"
}
},
{
"name": {
"value": "hey hey hey"
}
},
{
"name": {
"value": "hey hey hey hey"
}
},
{
"name": {
"value": "hey hey hey hey hey"
}
},
{
"name": {
"value": "hey hey hey hey hey hey"
}
},
{
"name": {
"value": "hey hey hey hey hey hey hey"
}
},
{
"name": {
"value": "hey hey hey hey hey hey hey hey"
}
},
{
"name": {
"value": "hey hey hey hey hey hey hey hey hey"
}
},
{
"name": {
"value": "hey hey hey hey hey hey hey hey hey hey"
}
},
{
"name": {
"value": "hey hey hey hey hey hey hey hey hey hey hey"
}
},
{
"name": {
"value": "hey hey hey hey hey hey hey hey hey hey hey hey"
}
}
]
}
]
}
}
}

关于Alexa - 包罗万象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49948118/

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