Choice
Introduction
The Choice Step in Voiceflow is a versatile step that allows you to direct the flow of your conversation based on user inputs. It enables your AI agent to recognize user intents and route the conversation accordingly. With the Choice Step, you can:
- Add multiple intents that the agent should listen for.
- Define required entities for each intent.
- Configure automatic reprompts to guide the user when necessary information is missing.
- Attach buttons to intents for quick user selection.
- Set up rules and exit scenarios to manage conversation flow.
This guide will walk you through:
- Adding a Choice Step to your project.
- Configuring intents within the Choice Step.
- Setting up required entities, automatic reprompts, buttons, rules, and exit scenarios.
- Managing multiple intents with independent paths.
Adding the Choice Step to Your Canvas
-
Open the Step Toolbar: On the left side of your Voiceflow workspace, you'll find the step toolbar containing various steps you can use in your project.
-
Drag the Choice Step onto the Canvas: Hover over Listen and locate the Choice step and drag it onto your canvas where you want to introduce decision-making based on user input.
Configuring the Choice Step
1. Adding Intents
Intents represent the possible actions or responses the user might provide at this point in the conversation.
Adding an Intent
-
Access the Intents Section: In the Choice Step editor, find the Intents label.
-
Click the "+" Button: Beside the Intents label, click the "+" button to add a new intent.
-
Select an Intent:
- Choose from Existing Intents:
- A dropdown will appear listing all available intents you've previously created.
- Select the intent you wish to add.
- Create a New Intent:
- Scroll to the bottom of the dropdown and select Create Intent.
- Follow the prompts to define a new intent, including name, description, example utterances, and required entities.
- Choose from Existing Intents:
Intent Modal
Once you select an intent, a modal window will pop up allowing you to configure additional settings for that intent.
Intent Selection
- Change Intent (Optional):
- If needed, you can change the selected intent using the dropdown at the top of the modal.
Required Entities
-
Overview:
- Required Entities are specific pieces of information needed to fulfill the intent.
- Adding required entities ensures that the agent collects all necessary data before proceeding.
-
Adding Required Entities:
- Click the "+" Button in the Required Entities section.
- Select Entities:
- Choose from existing entities or create a new one.
- Configure Each Entity (if applicable):
- Provide prompts or validation rules specific to the entity.
-
Effects of Adding Required Entities:
- Automatic Reprompt Toggle Appears: This feature helps the agent prompt the user for missing information.
- New Sections Displayed:
- Rules
- Exit Scenarios
Automatic Reprompt
-
Purpose:
- Automatically generates prompts to ask the user for any missing or invalid entities required for the intent.
-
Default Setting:
- The Automatic Reprompt toggle is ON by default when required entities are added.
-
Configuring Automatic Reprompt:
- Toggle Automatic Reprompt: Ensure it is turned ON.
- Access Settings:
- Click on the settings icon or label next to the toggle.
- Configure Model Settings:
- AI Model: Select the AI model to use for generating reprompts.
- Temperature: Adjust the creativity of the AI's responses. Lower values make the output more deterministic.
- Max Tokens: Set the maximum length of the AI's response.
- System Prompt: Optionally provide instructions to guide the AI in generating reprompts.
Buttons
-
Purpose:
- Attach a button to the intent, allowing users to trigger the intent by clicking rather than typing.
-
Adding a Button:
-
Navigate to the Buttons Section within the intent modal.
-
Click the "+" Button to add a new button.
-
Set Button Label:
- Enter the text for the button.
- You can use variables to personalize the button label (e.g., "Order {ProductName}").
-
-
Behavior:
- Users can either select the button or use natural language input to trigger the intent.
Rules and Exit Scenarios
-
Rules
- Purpose:
- Define conditions or validations that the user's input must meet for the entities.
- Adding Rules:
- Click the "+" Button in the Rules section.
- Write Natural Language Rules:
- Specify criteria for entity validation (e.g., "The date must be within the next 30 days").
- Purpose:
-
Exit Scenarios
- Purpose:
- Define conditions under which the agent should stop trying to capture required entities and proceed differently.
- Adding Exit Scenarios:
- Click the "+" Button in the Exit Scenarios section.
- Define Exit Conditions:
- Specify phrases or situations indicating the user cannot provide the required entities (e.g., "I don't know", "Skip this").
- Exit Scenario Path Toggle:
- Toggle ON: Creates a separate exit path for this exit scenario.
- Toggle OFF: The conversation continues through the main intent path even if an exit scenario is triggered.
- Purpose:
2. Managing Multiple Intents
You can add multiple intents to a single Choice Step, each with its own configuration.
Adding Multiple Intents
- Repeat the process of adding intents for each new intent you want to include.
Independent Configurations
-
Each intent can have:
- Its Own Required Entities
- Separate Automatic Reprompt Settings
- Individual Buttons
- Specific Rules
- Unique Exit Scenarios and Paths
Exit Scenario Paths
- Main Port: The default path the conversation follows when the intent is successfully fulfilled.
- Exit Scenario Port: An optional secondary path that is followed if an exit scenario is triggered for that intent.
Connecting Paths Based on Intents
Each intent you add to the Choice Step creates a port on the step, allowing you to define different conversation paths.
How to Connect Paths
-
Locate the Ports: On the bottom of the Choice Step, you'll see ports labeled with your intent names.
-
Connect to Other Steps:
- Intent Port:
- Connect this port to the next step in the conversation when the intent is successfully triggered and required entities are captured.
- Exit Scenario Port (if enabled):
- Connect this port to an alternative path for handling situations where the user cannot provide required entities.
- Intent Port:
-
No Match and No Reply Ports:
- No Match:
- Handles inputs that do not match any of the intents.
- Enable No Match in the Choice Step settings to create this port.
- No Reply:
- Handles situations where the user doesn't respond.
- Enable No Reply to create this port.
- No Match:
Additional Options in the Choice Step
1. No Match
Purpose
- Handles situations where the user's input doesn't match any of the added intents.
How to Enable
- Toggle No Match to ON in the Choice Step editor.
Configuration
-
No Match Reprompt:
- Provide a message to prompt the user when their input doesn't match any intents (e.g., "I'm sorry, I didn't understand that. Could you please rephrase?").
-
Follow Path After Reprompts:
- Toggle ON: After reprompts are exhausted, the conversation will follow the No Match path.
- Toggle OFF: The agent will continue to reprompt indefinitely.
No Match Path
- Enabling No Match creates a No Match port on the Choice Step.
- Connect this port to a step that handles unmatched inputs, such as offering help or ending the conversation.
2. No Reply
Purpose
- Manages situations where the user doesn't respond within a specified time frame.
How to Enable
- Toggle No Reply to ON in the Choice Step editor.
Configuration
-
Inactivity Time:
- Set how long the agent should wait for a response before considering it a no-reply.
-
No Reply Reprompt:
- Provide a message to prompt the user when they haven't responded (e.g., "Are you still there?").
-
Follow Path After Reprompts:
- Toggle ON: After reprompts are exhausted, the conversation will follow the No Reply path.
- Toggle OFF: The agent will continue to reprompt indefinitely.
No Reply Path
- Enabling No Reply creates a No Reply port on the Choice Step.
- Connect this port to a step that handles no-response situations.
3. Listen for Other Triggers
Purpose
- Allows the agent to recognize and respond to other intents or events while the Choice Step is active.
How to Enable
- Toggle Listen for Other Triggers to ON in the Choice Step editor.
Behavior
- ON:
- The agent listens for other intents outside of the ones added to the Choice Step.
- If the user says something matching another intent, the agent will trigger that intent.
- OFF:
- The agent focuses solely on the intents within the Choice Step.
- Other intents will not be recognized until after the Choice Step is resolved.
Summary of Choice Step Configuration
-
Add Intents:
- Use the "+" button to add one or more intents.
- Configure each intent individually.
-
Configure Required Entities:
- Add required entities to each intent as needed.
- Enable Automatic Reprompt to assist users in providing necessary information.
-
Set Up Buttons:
- Optionally attach buttons to intents for user selection.
-
Define Rules and Exit Scenarios:
- Add rules to validate entity inputs.
- Set up exit scenarios to handle situations where users cannot provide required information.
- Decide whether to use an exit scenario path for each intent.
-
Configure Additional Options:
- No Match: Handle unrecognized inputs.
- No Reply: Manage user inactivity.
- Listen for Other Triggers: Allow or prevent recognition of other intents during this step.
-
Connect Paths:
- Use the ports created for intents, exit scenarios, No Match, and No Reply to define your conversation flow.
Practical Example: Booking an Appointment
Let's illustrate how to use the Choice Step with multiple intents, required entities, and exit scenarios.
Scenario
You want your agent to handle different appointment-related intents:
- Schedule Appointment
- Reschedule Appointment
- Cancel Appointment
Steps
-
Add a Choice Step to Your Canvas.
-
Add Intents:
-
Intent 1: ScheduleAppointment
- Required Entities:
AppointmentDate
AppointmentTime
- Automatic Reprompt: Enabled.
- Rules:
- "The appointment date must be at least 24 hours from now."
- Exit Scenarios:
- "If the user says 'I don't know when', 'I'm not sure yet'."
- Exit Scenario Path: Enabled.
- Button: "Schedule Appointment"
- Required Entities:
-
Intent 2: RescheduleAppointment
- Required Entities:
ExistingAppointmentID
NewAppointmentDate
NewAppointmentTime
- Automatic Reprompt: Enabled.
- Rules:
- "New appointment date must be different from the existing one."
- Exit Scenarios:
- "If the user says 'I changed my mind', 'Forget it'."
- Exit Scenario Path: Enabled.
- Button: "Reschedule Appointment"
- Required Entities:
-
Intent 3: CancelAppointment
- Required Entities:
AppointmentID
- Automatic Reprompt: Enabled.
- Button: "Cancel Appointment"
- Required Entities:
-
-
Configure No Match:
- Enable No Match: Toggle ON.
- No Match Reprompt: "I'm sorry, I didn't understand that. Please choose an option or tell me what you'd like to do."
- Follow Path After Reprompts: Toggle ON.
- Connect No Match Port: Direct to a help message or transfer to a human agent.
-
Configure No Reply:
- Enable No Reply: Toggle ON.
- Inactivity Time: Set to 30 seconds.
- No Reply Reprompt: "Are you still there? Please let me know how I can assist you."
- Follow Path After Reprompts: Toggle ON.
- Connect No Reply Port: End the conversation politely.
-
Listen for Other Triggers:
- Enable: Toggle ON.
-
Connect Paths:
- Schedule Appointment Port: Connect to steps that process scheduling.
- Reschedule Appointment Port: Connect to steps for rescheduling.
- Cancel Appointment Port: Connect to cancellation steps.
- Exit Scenario Ports: For each intent with exit scenarios, connect the exit scenario port to appropriate handling steps.
Conversation Flow Example
-
Agent: "Welcome! How can I assist you today?"
[Displays Buttons: Schedule Appointment | Reschedule Appointment | Cancel Appointment] -
User: "I need to schedule an appointment."
-
Agent: "Sure, when would you like to schedule your appointment?"
[CollectsAppointmentDate
andAppointmentTime
] -
User: "I'm not sure yet."
-
Agent: "No problem. Feel free to let me know when you're ready."
[Follows the Exit Scenario Path forScheduleAppointment
] -
User: "Actually, can I reschedule my existing appointment?"
-
Agent: "Certainly! May I have your appointment ID?"
[Switches toRescheduleAppointment
intent] -
User: [Provides information]
Best Practices
-
Clear Intent Definitions: Ensure each intent has a clear purpose and is not overlapping significantly with others.
-
Effective Prompts: Write prompts that guide the user effectively toward providing the necessary information.
-
Thoughtful Use of Exit Scenarios: Use exit scenarios to enhance user experience, allowing them to gracefully opt-out or skip steps.
-
Consistent Configuration: Keep settings like Automatic Reprompt and Listen for Other Triggers consistent where appropriate to avoid confusing the user.
-
Testing: Simulate various conversation paths to ensure that all intents, entities, and scenarios work as intended.
-
User-Friendly Buttons: If using buttons, make sure labels are clear and actions are immediately understandable.
Updated 5 days ago