Home NewsX How to Introduce Custom Delay Between Two Messages in Azure Bot Composer

How to Introduce Custom Delay Between Two Messages in Azure Bot Composer

by info.odysseyx@gmail.com
0 comment 15 views


Improve user experience with timely responses

Building conversational bots using Azure Bot Composer offers countless possibilities for creating seamless and engaging user experiences. One feature that can greatly improve user interaction is introducing a custom delay between two messages. This small but impactful addition mimics human-like pauses to make conversations feel more natural and thoughtful.

This blog walks you through the steps to introduce a custom inter-message delay in Azure Bot Composer.

Introducing a delay between messages can serve several purposes.

  • Natural Flow: Emulates human conversation, making interactions feel less robotic.
  • Attention Management: Give users time to read and process information before moving on to the next message.
  • Contextual relevance: This helps keep you in context, especially in scenarios where the bot provides detailed explanations or instructions.
  • Expected latency: Azure Bot Builder often makes outbound calls and gets a response back, and for example, if you want to get a token, it may take some time to get the desired response. In return, we would like to introduce an intentional delay in such scenarios.

Before introducing custom delays, ensure that Azure Bot Composer is installed and set up. You can download it from the official GitHub repository and follow the provided installation instructions.

Composer Installation

Step 1: Open your bot project

Start Azure Bot Composer and open an existing bot project or create a new project. Go to the dialog where you want to introduce a delay.

Step 2: Add a new task

Within the dialog box, click the ‘+ Add’ button to insert a new task. Select ‘Send Response’ from the list of available actions. This message is intended to introduce delay.

[Activity
Type = delay
Value = "5000"
]

You will need to add this code as JSON by clicking View Source Code and then adding it above. It should look like this:

meenakshiBalekar_0-1729513983120.png

Enter the message text you want to send after the delay. This can be text such as follow-up questions or additional information.

By default, input activity lasts for a short period of time. To customize the delay, you can adjust the input activity duration. Click the input activity and set the desired duration (in milliseconds) in the Properties window. For example, a setting of 3000 milliseconds results in a 3 second delay. Keep this value under 15 seconds.

Step 3: Test your bot

After configuring the delay and follow-up messages, it’s time to test your bot. To launch the Bot Framework Emulator, click the ‘Test on Emulator’ button. Interact with the bot to verify that delays are working as expected and messages are being sent in the correct order.

Introducing custom delays between messages in Azure Bot Composer is a simple yet powerful way to improve the user experience. By following the steps outlined in this guide, you can create more natural, engaging conversations that keep your users interested and informed.





Source link

You may also like

Leave a Comment

Our Company

Welcome to OdysseyX, your one-stop destination for the latest news and opportunities across various domains.

Newsletter

Subscribe my Newsletter for new blog posts, tips & new photos. Let's stay updated!

Laest News

@2024 – All Right Reserved. Designed and Developed by OdysseyX