【问题标题】:How to feed Watson Assistant context variable before arriving at Assistant node V2 on node red如何在到达节点 red 上的 Assistant 节点 V2 之前提供 Watson Assistant 上下文变量
【发布时间】:2021-11-21 15:24:28
【问题描述】:

对 我使用 Node Red 将 Watson Assistant 与 Telegram 集成。

它按预期工作。发送消息时,它会立即响应。

因此,我将成为 Watson 响应中的“$username”变量,并且无法为其分配值 (img1)。

由于 Watson 节点接收到带有电报 (img2) 发送的消息内容的 paload,我不知道如何传递用户。

最后,Watson 返回的答案多了一个空格,因为它预计会在通过 Assistant 节点 (img3) 之前接收到变量。

完整的流程在这里。现在我只需要以某种方式将电报的 first_name 分配给这个 $user 变量

提前致谢

【问题讨论】:

  • 图片1和2被错误交换了

标签: variables bots telegram node-red watson-assistant


【解决方案1】:

您可以通过添加到msg.additional_context 来添加其他上下文数据。例如。

msg.additional_context.user = 'XYZ'

msg.additional_context['user'] = 'XYZ'

【讨论】:

  • OOOH 真的成功了,非常感谢!
猜你喜欢
  • 1970-01-01
  • 2019-10-01
  • 1970-01-01
  • 1970-01-01
  • 2020-12-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多