简体   繁体   English

如何要求用户在 DialogFlow 中添加新元素?

[英]How to ask the user to add new element in DialogFlow?

I am trying to build a bot in Dialogflow.我正在尝试在 Dialogflow 中构建一个机器人。

Here is what I need:这是我需要的:

customer: Hello 
bot: hello, what's your name? 
customer: John 
bot: Please enter the first element. 
customer: element1 
bot: Did you finish? 
customer: No 
bot: Please enter the second element. 
....

Please advise how can I implement it?请告知我该如何实施? I am trying to create an intent with action and prompt but the agent doesn't ask me "Please enter the first element".我正在尝试通过操作和提示创建意图,但代理没有问我“请输入第一个元素”。

I also need to make first, second.. a counter that updates with each iteration / question.我还需要制作第一个,第二个.. 一个随每次迭代/问题更新的计数器。

Can you please advise where can I find a guideline how to achieve this kind task?您能否告知我在哪里可以找到如何完成此类任务的指南?

So far I have created an agent and playing with intents.到目前为止,我已经创建了一个代理并使用了意图。

One way would be to write some code for fulfillment (using webhook or even inline editor), analyze incoming messages in your code and generate answer.一种方法是编写一些代码来实现(使用 webhook 甚至内联编辑器),分析代码中的传入消息并生成答案。

If you don't want to write any code, it should be also possible to achieve this using Dialogflow's context to store some information and followup intents to continue asking for elements.如果您不想编写任何代码,也应该可以使用 Dialogflow 的上下文来存储一些信息和后续意图以继续请求元素。 But in case you would like to ask user for multiple elements - it could be hard to maintain in Dialogflow.但如果您想向用户询问多个元素 - 在 Dialogflow 中可能很难维护。 I have created and tested sample bot this way with following intents:我以这种方式创建并测试了示例机器人,其意图如下:

在此处输入图像描述

Please note that I have removed default Welcome intent to not interfere with custom "hello" intent.请注意,我已删除默认的欢迎意图,以免干扰自定义的“你好”意图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM