watson-developer-cloud / assistant-simple

A simple sample application demonstrating the Watson Assistant api.
https://assistant-simple.ng.bluemix.net/
Apache License 2.0
481 stars 1.14k forks source link

Accessing the state property of system object in the skills object of context variable in ibm watson assistant v2 api #257

Open developer-bz opened 4 years ago

developer-bz commented 4 years ago

This is not an issue, rather something informative. I could read from the ibm watson assistant v2 api documentation that there is a state property which provides information about the current conversation state. It also says that it is an encoded string. Is there any way i can decode this string and get the information on the current conversation state? If yes, please provide the steps to decode it.

Below is the format of the json object where state property is present,

context: {
  skills: {
    ['main skill']: {
        user_defined: {},
        system: {
          state: "eyJzZXNzaW9uX2lkIjoiNGNlMTlksomerandomstringBmLTlhZWMtNTBjYjcxM2I4YjkzIiwic2tpbGxfcmVmZXJlbmNlIjoibWFpbiBza2lsbCI...................................................."
        }
      }
    }
  }

Also find the link to the documentation, https://cloud.ibm.com/apidocs/assistant/assistant-v2#send-user-input-to-assistant

Thanks in advance

germanattanasio commented 4 years ago

@mitchmason ☝️

developer-bz commented 4 years ago

@mitchmason can you please provide your inputs?

Thanks in advance

mitchmason commented 4 years ago

Setting debug:true in the options object should return all the info you want. At this time you cannot pro-actively edit the state object you are seeing there to manipulate it, but you can get the same info via debug:true. Editing the state in v2 api is on the roadmap. If you absolutely need to edit the state then I'd suggest using v1 in the meantime.

developer-bz commented 4 years ago

Thanks @mitchmason @germanattanasio . I already have debug set to true in the options object. But it isn't giving me the information related to digressions. Can you tell me the way to get information on digressions? Like v1 api has digressed:true in the system context variable. Getting atleast digressed:true would be of great help with v2 api.