有没有一种方法可以在dialogflow或动态列表响应中显示动态建议芯片?

问题描述 投票:0回答:1

我正在尝试向用户显示商店,但是商店必须是动态的,并且应该根据用户的当前位置来自数据库。

位置1的用户

user: show nearby stores
assistant: I need your location, can I get that?
user: yes
assistant: you are at location1, these are the stores near you.
    Store1, Store2, Store3 (Suggestion Chips)

假设用户明天在不同的位置并提出相同的问题,那么他应该可以看到其他商店。

位置2的用户

user: show nearby stores
assistant: I need your location, can I get that?
user: yes
assistant: you are at location2, these are the stores near you.
    Store4, Store5, Store6 (Suggestion Chips)

我想根据用户的位置以建议筹码或列表响应的形式动态显示这些存储。

node.js dialogflow actions-on-google
1个回答
0
投票

您是否正在使用网络挂钩?那将是动态进行任何事情的标准方法。

codelab显示了如何使用Dialogflow内联编辑器进行动态响应。您可以使用标准的JavaScript来实现决策逻辑并返回动态建议芯片。

如果要获取用户位置,则需要使用权限,也有简洁的helpers

如果您有到目前为止所尝试的内容的更多信息,我们可以为您提供更具体的资源。

© www.soinside.com 2019 - 2024. All rights reserved.