Reputation: 503
Currently I am creating a bot using API.AI, but I was questioning if there is a way to clean all the contexts of the intents, in a intent that receive a message like "Clean memory" or "Cancel Creation" .
For example: I have context-1, context-2, context-3; and I want to clean/eliminate all those contexts and start fresh.
Upvotes: 1
Views: 363
Reputation: 50701
Yes. In general, you can set the Output Contexts to include all the contexts that you want to clear and set their lifespan to 0.
The easiest way to do this is through a webhook, where you can look at all the contexts that are set and, if their lifespan isn't already 0, create an output context with the same name and set the lifespan to 0.
If you don't want to use a webhook, you can include this in the output context field when editing an Intent, but you need to list each context individually and set the lifespan to 0.
Upvotes: 2