In Dialogflow fulfillment I am trying to add or update parameters for a context.
let currentContext = agent.context.get('setupcall-followup');
console.log(agent.context.get('setupcall-followup').parameters); //1
currentContext.parameters.date = '2019-09-18T12:00:00-04:00';
currentContext.parameters.time = '2019-09-17T13:00:00-04:00';
currentContext.parameters['Test'] = 'Test';
console.log(agent.context.get('setupcall-followup').parameters); //2
agent.context.set(currentContext); //Seems to not be needed, since it is by reference
console.log(agent.context.get('setupcall-followup').parameters); //3, same as #2
By #2 & #3 the log shows that it was updated. But in the Diagnostic Info > Raw API Response, the outputContext information is still the original inputContext, before modification.
What I can do:
- Add a new context, with it's own parameters.
What I can't do
- Get a context & change a parameter