-1

In IBM Watson Conversation, context variables can be used to carry information. A value can be derived from the evaluation of expressions as shown:

"context": {
    "mycity": "<? entities['city'].value ?>"
  }

What I tried is to dynamically compose the variable name:

"context": {
    "my<? @animals ?>": "my new value"
  }

However, the expression in the variable name is not evaluated. How can I define a variable name based on available data such as intents, entities or other context variables?

data_henrik
  • 16,724
  • 2
  • 28
  • 49

1 Answers1

0

One solution seems to be to do it in the application:

  • Receive response object including all the metadata.
  • Extract necessary data
  • Compose context object to be passed back into Watson Conversation for next message processing. Create new variables as part of this preparation.
  • Call message API with context object which includes new variable.
  • New variable is available during Watson Conversation-internal processing.
data_henrik
  • 16,724
  • 2
  • 28
  • 49