简体   繁体   English

如何在MessageResponse Watson Assistant Java客户端中获取“动作”数据

[英]How to get “actions” data in MessageResponse Watson Assistant Java client

I am using IBM Watson Assistant Java client to develop a client application: 我正在使用IBM Watson Assistant Java客户端来开发客户端应用程序:

Assistant service = new Assistant("2018-02-16");

I have read the recommended approach to process client side actions triggers from workspace: 我已经阅读了推荐的方法来处理来自工作区的客户端操作触发器:

https://console.bluemix.net/docs/services/conversation/dialog-actions.html#dialog-actions?cm_sp=dw-bluemix- -nospace- -answers https://console.bluemix.net/docs/services/conversation/dialog-actions.html#dialog-actions?cm_sp=dw-bluemix- -nospace- -answers

But I can't find where to get the "actions" content I enter in the node as described in that page, in the MessageResponse object where response is returned (it has intents, response, contexts... but no "actions") 但是我找不到该页面中所述的节点中输入的“操作”内容的获取位置,该对象在返回响应的MessageResponse对象中(它具有意图,响应,上下文...,但没有“操作”)

How should client know if the workspace node requests the execution of an action? 客户应该如何知道工作空间节点是否请求执行动作?

"Actions" is something you create by yourself by opening the JSON Editor. 您可以通过打开JSON编辑器自行创建“操作”。 The idea is that if you cannot catch something through context, you can send additional "actions" flag to your backend. 这样的想法是,如果您无法通过上下文捕获某些内容,则可以向后端发送其他“操作”标志。 Here is an example of the JSON: 这是JSON的示例:

{
  "context": {
    "request_type": "@requesttype"
  },
  "output": {
    "text": {
      "values": [
        "Your appointment is confirmed"
      ],
      "selection_policy": "sequential"
    },
    "action": {
      "period": "multi",
      "user": "outsider"
    }
  }
}

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

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