Timing is a crucial aspect of building agentic contextual AI with Colang 2.0. The way your chatbot manages when to respond, follow up, or wait can make the difference between a robotic and a natural, engaging conversation. By controlling timing, you can add realism, provide helpful reminders, and keep users informed during longer processes.
In this lesson, you’ll learn how to use Colang’s timing commands to:
- Add realistic delays to bot responses
- Set up reminders or follow-ups when the user is silent
- Trigger actions at regular intervals
You can use wait to add a short pause before your bot replies, making the conversation feel more natural.
This example makes the bot wait half a second between the two messages.
To inform the user if the bot has not spoken for a while:
This keeps the user updated if something is taking time.
To check if the user has been quiet for a while:
This waits until the user has not said anything for 5 seconds, then sends a follow-up.
If you want to remind the user only if both sides are silent:
This is useful for gentle reminders without interrupting the user.
To perform actions at regular intervals, use repeating timer:
This starts a timer called "my_timer" that triggers every 0.4 seconds. Each time the timer triggers, an event is published to the channel.
To handle this event, use:
This allows you to specify what should happen every time the timer fires.
- Use
waitto add natural pauses to bot replies. - Use
bot was silent,user was silent, anduser didnt respondfor reminders and follow-ups. - Use
repeating timerfor periodic actions. - Combine timing commands to create more human-like, responsive conversations.
- Adjust timing values to fit your use case and user expectations.
Colang’s timing commands let you control when your bot responds, follows up, and performs actions. Mastering these tools helps you build chatbots that feel more natural and engaging. In the next practice, you’ll experiment with these timing features to see how they affect conversation flow.
