IBM Cloud Docs
Understanding digressions in dialog

Understanding digressions in dialog

In this tutorial, you see firsthand how digressions work.

Learning objectives

By the time you finish the tutorial, you learn how:

  • Digressions are designed to work.
  • Digression settings impact the flow of the dialog.
  • To test digression settings for a dialog.

Duration

This tutorial takes approximately 20 minutes to complete.

Step 1: Get the Digressions Showcase dialog

You use the Digression Showcase dialog as an example in this tutorial.

  1. Download digression-showcase.json from the IBM GitHub repository.

  2. Next, upload the JSON file to your assistant.

If you are using dialog in watsonx Assistant:

  1. The upload overwrites any existing dialog. Use an assistant without an existing dialog, then activate dialog.

  2. In Dialog, click Upload/Download.

  3. Upload digression-showcase.json.

If you are using a dialog skill in the classic experience:

  1. On Skills, click Create skill.

  2. Choose Dialog skill, then click Next.

  3. Choose Upload skill, then upload digression-showcase.json.

Step 2: Temporarily digressing away from dialog

Digressions allow users to break away from a dialog branch to temporarily change the topic before they return to the original dialog flow. In this step, you start to book a restaurant reservation, then digress away to ask for the restaurant's hours. The assistant provides opening hours information, then returns to the restaurant booking dialog flow.

  1. Click Dialog to open the dialog tree.

  2. Click Try it.

  3. Type Book me a restaurant.

    Your assistant responds with When do you want to go?.

  4. To highlight the node that triggered the response, click the Location icon Location.

    The Restaurant booking node is highlighted in the dialog tree.

    Shows the Restaurant booking node that is highlighted and the dialog in progress in the Try it out pane.
    Restaurant booking node

  5. Type Tomorrow.

    Your assistant responds with a prompt for the time to reserve What time do you want to go?.

  6. You do not know when the restaurant closes, so you ask, What time do you close?

    The assistant digresses away from the restaurant booking node to process the Restaurant opening hours node. It responds with, The restaurant is open from 8:00 AM to 10:00 PM.. Your assistant then returns to the restaurant booking node, and prompts you again for the reservation time.

    Shows the digression happen in the Try it out pane.
    Digression

  7. Optional: To complete the dialog flow, type 8pm for the reservation time and 2 for the number of guests.

You digressed away from and returned to a dialog flow.

Step 3: Disabling slot digressions

In this step, you edit the digression setting for the restaurant booking node to prevent users from digressing away from it, and see how the setting change impacts the dialog flow.

Look at the current digression settings for the Restaurant booking node.

  1. Click the node to open it in edit view.

  2. Click Customize, and then click the Digressions tab.

    Shows the digression settings for the Restaurant booking node.
    Digression settings

  3. Click to expand Digressions can go away from this node.

  4. Set the Allow digressions away while slot filling switch to Off, and then click Apply.

  5. Click the Close icon Close to close the node edit view.

  6. Click Try it.

  7. Click Clear in the "Try it out" pane to start over.

  8. Type Book me a restaurant.

    Your assistant responds with a prompt for the day to reserve, When do you want to go?

  9. Type Tomorrow.

    Your assistant responds with a prompt for the time to reserve, What time do you want to go?

  10. Ask, What time do you close?

    Your assistant recognizes that the question triggers the #restaurant_opening_hours intent, but ignores it and displays the prompt that is associated with the @sys-time slot again instead.

You prevented the user from digressing away from the restaurant booking process.

Step 4: Digressing to a node that does not return

You can configure a dialog node to not go back to the node that your assistant digressed away from for the current node to be processed. To demonstrate this configuration, you change the digression setting for the restaurant hours node. In Step 2, after you digress from the restaurant booking node to go to the restaurant opening hours node, your assistant returns to the restaurant booking node to continue with the reservation. In this exercise, after you change the setting, you digress from the Job opportunities node to ask for opening hours and see that your assistant does not return to where it left off.

  1. Click to open the Restaurant opening hours node.

  2. Click Customize, and then click the Digressions tab.

  3. Click to expand Digressions can come into this node, and deselect the Return after digression checkbox.

  4. Click Apply.

  5. Click the Close icon Close to close the node edit view.

  6. Click Try it.

  7. Click Clear in the "Try it out" pane to start over.

  8. Type I'm looking for a job.

    Your assistant responds by saying, We are always looking for talented people to add to our team. What type of job are you interested in?

  9. Instead of answering this question, ask an unrelated question. Type What time do you open?

    Your assistant digresses away from the Job opportunities node to the Restaurant opening hours node to answer your question. Your assistant responds with The restaurant is open from 8:00 AM to 10:00 PM.

    Unlike in the previous test, this time the dialog does not pick up where it left off in the Job opportunities node. Your assistant does not return to the dialog that was in progress because you changed the setting on the Restaurant opening hours node to not return.

You digressed away from a dialog without returning.

Summary

In this tutorial you experienced how digressions work, and saw how individual dialog node settings can impact the digressions behavior.