简体   繁体   中英

How to send and append new context variable to Watson Assistant skills via V1 API using python?

We have made a bot using numeric data and are now testing the possibility to enhance the system by using python V1 API to further analyze the data. Python results should then be send back to skills to further use and improve the bot.

Python code discusses well with skills, giving the right context and context can be updated as well in python code.

We just can't get how to send/update new context with new variables back to skills. How to see it appended in skills context variable list?

The context of Watson Assistant is stored in JSON format. The request or response (in v1 API ) contain context field. Eg

"context" : {
  "system" : { ... system stuff, do not touch},
  "variable1" : "value1",
  "my_array" : ["one", "two", "three"]
}

So only thing one must do in order to add a new variable to the context or to change value of a variable in the context one needs to modify this context field.

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