(对话流)如何将place API的位置信息存储到intent参数中


conv.ask(`Fetching your request...`);
conv.ask(new Image({
url: photo_request,
alt: 'Restaurant photo',
}))
conv.close(`Okay, the restaurant name is ` + name + ` and the address is ` + address + `. The following photo uploaded from a Google Places user might whet your appetite!`);

这部分代码只是在控制台上显示文本响应。我想将信息存储到意图的参数值中

对话的参数属性用于Dialogflow在用户短语中检测到的参数。这些属性是只读的,不能用于存储值。

如果您希望存储值以供以后在会话中使用,可以使用会话上下文来存储值。可以通过设置上下文对象上的参数字段来保存数据。

最新更新