assistant-simple
assistant-simple copied to clipboard
How can I add a context variable in api.js?
I can add a context variable by editing the payload in app.js, but I would like to update a context variable when a user submits a message. I tried changing the payload in api.js to look like this:
var payloadToWatson = {
session_id: sessionId,
input = {
message_type: 'text',
text: text,
options: {
return_context: true
}
},
context : {
skills: {
"main skill" : {
user_defined: {
location : myVar
}
}
}
}
};
There is an updateMessage function according to the Watson API but the api.js component does not use this. Any ideas on how I can update the context variable? Thanks in advance.