如何根据 Dialogflow 中的实体值创建不同的答案

How to create different answers depending on an entity value in Dialogflow

这是我正在尝试做的一个例子。

假设我有一个名为 Animal 的实体,其值为 DogCat, 鹦鹉

我希望机器人回答:

@Animal 能活多久?

@Animal 有几条腿?

@Animal 会飞吗? 等等

我正在尝试创建一个 table 与每个 Animal 关联的值。

谢谢

此处最好的选择是为每个要回答的问题创建一个意图。

所以,根据你的例子

1) 动物 - 预期寿命

训练短语

@ - How long does @Animal:Animal live?
@ - How many years do @Animal:Animal live?
@ - @Animal life expectancy
" - How long do elephants live

Webhook 回答

Elephants can live up to 70 years in the wild

2) 动物 - 腿

训练短语

" - How many legs does dogs have?
@ - How many legs does @Animal have?
@ - leg count of @Animal

Webhook 回答

Dogs have 4 legs.

3) 动物 - 苍蝇

训练短语

@ - Does @Animal fly?
" - Can cats fly?

Webhook 回答

No, cats can't fly.

实体


意图

图例:

 " - example mode
 @ - Template mode