Options
All
  • Public
  • Public/Protected
  • All
Menu

Class QuestionnaireControlInteractionModelProps

Props associated with the interaction model.

Hierarchy

  • QuestionnaireControlInteractionModelProps

Properties

Optional actions

Action slot-values associated to the capabilities of the control as a whole

Default:

{
   activate: ['builtin_start', 'builtin_resume'],
   complete: ['builtin_complete']
}

Action slot-values associate utterances to a control. For example, if the user says "change the time", it is parsed as a GeneralControlIntent with slot values action = change and target = time. Only controls that are registered with the change action should offer to handle this intent.

Usage:

  • This allows users to refer to an action using more domain-appropriate words. For example, a user might like to say 'show two items' rather that 'set item count to two'. To achieve this, include the slot-value-id 'show' in the list associated with the 'set' capability and ensure the interaction-model includes an action slot value with id=show and appropriate synonyms.
  • The 'builtin_*' IDs are associated with default interaction model data (which can be extended as desired). Any other IDs will require a full definition of the allowed synonyms in the interaction model.

Optional allQuestionTargets

allQuestionTargets: string[]

All target slots that are used by individual questions.

Default: []

Purpose:

  • the user may give an answer to a specific question, e.g. "I like cats" which is parsed as a ValueControlIntent with value=like target=cats. To achieve this, the slotType associated with this control must include the value 'like' and the targets slotType must include 'cats'.

Why can't the targets be pulled from questionnaire content?

  • because the questionnaire content is dynamic at runtime, but the complete list of targets must be known at build time.

Control behavior:

  • at build time, all the targets listed here will be verified to exist in the interaction model.

Optional filteredSlotType

filteredSlotType: undefined | string

Slot type that includes entries for the answers that do not conflict with the sample utterances of built-in intents or custom intents.

Default: identical to slotType.

Purpose:

  • During interaction-model-generation the filteredSlotType is used in sample-utterances that would cause conflicts if the regular slotType was used.
  • If utterance conflicts persist the skill will not receive the built-in intent which may break other interactions.

Example:

If the questionnaire answers are "yes", "no" and "maybe", the slotType should have values for all three and filteredSlotType should only have "maybe".

interactionModel: {
  slotType: 'YesNoMaybe',
  filteredSlotType: 'Maybe'
}

Optional slotType

slotType: undefined | string

Slot type that includes entries for the answers provided by the questionnaire.

Default: none

If the questions are not strictly yes/no, slotType provides the values that the user can say. Every legal answer should be present in slotType and all legal answers that are not in conflict with other sample utterances should be present in filteredSlotType.

Example:

If the questionnaire answers are "yes", "no" and "maybe", the slotType should have values for all three and the filteredSlotType should only have "maybe".

interactionModel: {
  slotType: 'YesNoMaybe',
  filteredSlotType: 'Maybe'
}

Optional targets

targets: string[]

Target-slot values associated with this Control as a whole.

These targets are used to associate utterances to 'the questionnaire' as a whole. For example, if the user says "open the questionnaire", it will be parsed as a GeneralControlIntent with slot values action = open and target = questionnaire.

Default: ['builtin_it', 'builtin_questionnaire']

Usage:

  • If this prop is defined, it replaces the default; it is not additive to the defaults. To add an additional target to the defaults, copy the defaults and amend.
  • A control can be associated with many targets, eg ['questionnaire', 'customerServiceFeedback', 'feedback']
  • It is a good idea to associate with general targets (e.g. feedback) and also with specific targets (e.g. customerServiceFeedback) so that the user can say either general or specific things.
  • The association does not have to be exclusive, and general target slot values will often be associated with many controls. In situations where there is ambiguity about what the user is referring to, the parent controls must resolve the confusion.
  • The 'builtin_*' IDs are associated with default interaction model data (which can be extended as desired). Any other IDs will require a full definition of the allowed synonyms to be added to the interaction model.

Control behavior:

  • The control will not handle an input that mentions a target that is not defined by this prop.