[英]How can I take a random input value as a slot variable in Google Actions NLP (google assistant) Console?
假设我有一个应用程序,我想在其中向某人提供某个城市的天气。
第一个场景有一个提示:“你喜欢哪个城市的天气?”
然后我必须收集一个名为 conv.param.city: 的槽/参数,然后在我的节点 webhook 中使用它,它是:
const { conversation } = require('@assistant/conversation');
const functions = require('firebase-functions');
const app = conversation();
app.handle('schedule', (conv, {location}) => {
let temperature = callApi(location);// this part doesn't matter right now
**conv.add(`You want to know the weather in ${location}`);
conv.close(`The weather in ${location} is ${temperature}`);
});
exports.ActionsOnGoogleFulfillment = functions.https.onRequest(app);
据我所知,您只能接受由类型/意图预定义的参数/插槽。 我无法列出所有可供训练的城市。 我该怎么说:无论用户在这一点上说什么,都将这个词放入这个变量中。
如何使用 Google Actions SDK 执行此操作?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.