Beyond single-turn command-and-control stories, Diatheke can model complex dialogues with multiple interactions between the user and the system. Diatheke can prompt the user for more information (“slot filling”) and can respond to multiple different intents in the context of the same story.
All entities are by default optional. That means it is okay if they are not specified by the user. A story can also define some slots as required for a given intent. If the user doesn’t include a required entity in the initial utterance, Diatheke will prompt the user. This is called “slot filling” and is the most common form of multi-turn dialogue.
For example, in the apply_filter_story, the image_filter slot is required. If the user says “Apply vintage filter”, Diatheke immediately returns the apply_filter_command, but if they just say “apply filter”, Diatheke will prompt “What filter do you want to apply?” The user can then answer just “vintage” to fill in the slot.
Modeling this interaction flow involves multiple files:
init_actions:
- type: reply
id: welcome_message
- type: input
id: main_input
start_actions:
- type: input
id: main_input
input_actions:
- name: main_input
intents:
# In this example, required_slots has been added to the apply_filter_intent
- intent_id: apply_filter_intent
required_slots:
- image_filter
actions:
- type: story
id: apply_filter_story
- intent_id: zoom_intent
actions:
- type: story
id: zoom_story
defaults:
no_intent_actions:
- type: reply
id: no_intent_reply
language_data:
en_US:
example_utterances:
- Apply ${image_filter} filter
- Apply ${image_filter}
- Make the picture look ${image_filter}
- Apply a ${image_filter} filter
- Apply the ${image_filter} filter
- ${image_filter} filter
slot_prompts:
- slot: image_filter
reply_id: prompt_for_image_filter
language_data:
en_US:
- Which filter would you like to apply?
language_data:
en_US:
example_utterances:
- ${image_filter}
format: value_list
language_data:
en_US:
values:
- vintage
- lomo
- clarity
- sin city
- sunrise
- cross process
- orange peel
- love
- grungy
- jarques
- pinhole
- old boot
- glowing sun
- hazy days
- her majesty
- nostalgia
- hemingway
- concentrate
- black and white
- bright
- greyscale
- grayscale
start_actions:
- type: command
id: apply_filter_command
- type: reply
id: apply_filter_reply
# This command applies the requested filter to the photograph.
inputs:
- image_filter
outputs: # This command returns nothing.
language_data:
en_US:
- Applying ${image_filter} filter.
Next we’ll extend the Apply Filters story to include multiple intents by allowing the users to ask what filters are available.