简体   繁体   中英

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

I am using IBM Watson Assistant Java client to develop a client application:

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

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")

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. 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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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