【问题标题】:Getting Text Input in Google Actions(recent version)在 Google Actions 中获取文本输入(最新版本)
【发布时间】:2021-03-20 21:05:57
【问题描述】:

如何从动作 SDK(最新版本)获取用户输入。 在之前的版本中,我们只是像示例一样使用文本意图

app.intent('actions.intent.TEXT', async (conv, input) => {
   console.log('input', input)
})

我想像以前的版本一样获得用户输入,但以前的版本已弃用。 如何从操作生成器获取用户输入?

在最近的版本中,他们提供了意图、场景、类型等...

【问题讨论】:

    标签: actions-on-google google-assistant


    【解决方案1】:

    custom NLU sample 提供了将用户的全文发送到您的 webhook 以进行处理的示例。

    这是通过一个简单的user_utterance intent 来完成的,它接受freeText,然后是calls a webhook

    然后你的 webhook 就可以处理 Intent 的参数了:

    app.handle('doAny', (conv) => {
        const any = conv.intent.params.any.original;
        conv.add(`You said ${any}.`);
    });
    

    【讨论】:

    • 谢谢@Nick Felker。如果我们想要 NLP,我可以知道为什么他们提供了我们已经有 Dialogflow 的意图、场景和类型。如果你知道请告诉我
    • Actions Builder 与 Dialogflow 正交。您可以将任一用于 NLP。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 2023-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-04
    相关资源
    最近更新 更多