Kevin
Kevin

Reputation: 11662

Optional Input Context in dialogflow

I have a voice commands such as

- turn on lights in the lounge
- turn on lights in the kitchen

The room (lounge, kitchen) and is a mandatory parameter is stored as a context variable.

My question is - is there a way to have an optional input context for an intent. If context exists, use data from it, otherwise get the user to specify the context via slot filling.

Without this feature, it seems I need to have two intents which are almost identical.

- TurnOnLights_WithContext
- TurnOnLights_WithoutContext

Upvotes: 2

Views: 1127

Answers (1)

Kevin
Kevin

Reputation: 11662

The solution is to set the default value for the parameter from the context. If the value exists in the context it will be set. If not, the user will have to specify the value via slot-filling.

See screenshots below

enter image description here

enter image description here

Upvotes: 2

Related Questions