1
votes

I'd like to structure my Watson Assistant context variables into subgroups, but, e.g. saving a recognized value or entity in context as

"some": {
    "thing": "@an_entity"
}

but I'm not sure what syntax to use in the "Save It As" field. If I try to use the syntax describe in the documentation I get a warning

enter image description here

and if I open the JSON editor I get generated redundant entries like these

{
  "context": {
    "some": {
      "thing": "@an_entity"
    },
    "some.thing": "@an_entity"
  }
}

which then seem to proliferate (rather than change) every time I edit the "Save It As" field.

How do I use Watson Assistant slots to save a value in a field of a context variable?

1

1 Answers

0
votes

You're right, the slots UI only accepts simple variables (not objects). You can work with objects within the JSON as you've seen, but there will be redundancy (as you've also seen).

It's probably simplest to just adopt a consistent naming convention for your variables, e.g. $some_thing, $some_thing_else, etc., to keep things organized.