代码之家  ›  专栏  ›  技术社区  ›  Carlos Ferreira

如何列出我的机器人在Watson对话服务中使用的@Cities实体值

  •  2
  • Carlos Ferreira  · 技术社区  · 8 年前

    我有一个实体 @城市=奥斯汀、普罗维登斯、伦敦和波士顿 enter image description here 我只想回答这个问题,这个机器人与哪些城市合作? enter image description here

    然后回答:

    Here are the cities this works with $Locations ,  Which city do you want?
    
    1 回复  |  直到 8 年前
        1
  •  2
  •   data_henrik    8 年前

    在对话中, you have access to all the entities that were detected (recognized) in the user input 。但是,您无权访问所有已定义的实体及其可能的值。

    您可以使用允许的值定义一个上下文变量。该变量甚至可以动态填充(见下图) tutorial for database access from within Watson Assistant ).另一种选择是对响应进行硬编码。但这只适用于很少有价值和很少发生变化的情况。

    推荐文章