ExpectedInputs / possible_intents仅适用于“ assistant.intent.action.TEXT”吗? [英] ExpectedInputs / possible_intents only works with "assistant.intent.action.TEXT"?

查看:50
本文介绍了ExpectedInputs / possible_intents仅适用于“ assistant.intent.action.TEXT”吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试使用其他Web服务编写有关Google上的操作的演示。

I'm currently trying to write a demo for actions on google using a rest web service.

此刻,用户打开操作(与testaction交谈),并收到欢迎消息(通过主要目的)。此初始意图期望用户响应,并通过JSON响应中的possible_intents字段设置下一个期望意图。

At the moment the user opens the action ("talk to testaction") and is presented a welcome message (via the Main intent). This initial intent expects a user response and also sets the next expected intent via the possible_intents field in the JSON response

根据文档我应该能够在HTTP JSON响应的may_intents中指定自定义意图。

According to the documentation I should be able to specify a custom intent in possible_intents of my HTTP JSON response.

但是,如果我使用除 assistant.intent.action.TEXT之外的任何其他意图,则当我响应初始意图/提示时,会出现以下错误:

However, if I use any intent other than "assistant.intent.action.TEXT", once I respond to the initial intent / prompt, I get the following error:


对不起,我不明白。

Sorry, I did not understand.

这不起作用:

{
    "response": "...",
    "expectUserResponse": true,
    "conversationToken": "...",
    "audioResponse": "...",
    "debugInfo": {
        "agentToAssistantDebug": {
            "agentToAssistantJson": {
                "conversation_token": "...",
                "expect_user_response": true,
                "expected_inputs": [
                    {
                        "input_prompt": {
                            [...]
                        },
                        "possible_intents": [
                            {
                                "intent": "testintent"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

这有效:

{
    "response": "...",
    "expectUserResponse": true,
    "conversationToken": "...",
    "audioResponse": "...",
    "debugInfo": {
        "agentToAssistantDebug": {
            "agentToAssistantJson": {
                "conversation_token": "...",
                "expect_user_response": true,
                "expected_inputs": [
                    {
                        "input_prompt": {
                            [...]
                        },
                        "possible_intents": [
                            {
                                "intent": "assistant.intent.action.TEXT"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

我的testintent在动作包中正确定义,并且如果我直接调用它也可以正常工作。

my testintent is properly defined in the actions package and works just fine if I call it directly.

真的只能使用通用文本意图,然后我必须自己在代码中进行所有文本匹配和意图识别?

Is it really only possible to use the generic TEXT intent and I then have to do all of the text-matching and intent recognition myself in code?

推荐答案

使用操作时SDK,仅支持TEXT Intent。您必须使用自己的NLU来解析用户提供的原始文本输入。

When using the Actions SDK, only the TEXT intent is supported. You have to use your own NLU to parse the raw text input provided by the user.

如果您没有自己的NLU,则建议使用API​​.AI。

If you don't have your own NLU, then we recommend using API.AI.

这篇关于ExpectedInputs / possible_intents仅适用于“ assistant.intent.action.TEXT”吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆