Fundamental Core Flows (core.co)#
The core library that contains all relevant flows related to user and bot utterance events and actions.
User Event Flows#
- user said $text -> $transcript
Wait for a user to have said the provided text using an exact match.
Example:
- user said something -> $transcript
Wait for a user to have said something matching any transcript.
Example:
- user saying $text -> $transcript
Wait for a user to say the given text while talking (this matches the partial transcript of the user utterance even if the utterance is not finished yet).
Example:
- user saying something -> $transcript
Wait for any ongoing user utterance (partial transcripts).
Example:
- user started saying something
Wait for start of user utterance
Example:
- user said something unexpected -> $transcript
Wait for a user to have said something unexpected (no active match statement for the user utterance that matches the incoming event). This is a rather technical flow. If you are looking for a way to react to a wide variety of user messages check out the flows in
llm.co
.Example:
Bot Action Flows#
- bot say $text
Execute a bot utterance with the provided text and wait until the utterance is completed (e.g. for a voice bot this flow will finish once the bot audio has finished).
Example:
Semantic variants
For more expressive interaction histories and more advance use cases the
core.co
library provides several semantic wrappers forbot say
. You can use them anywhere instead of abot say
to annotated the purpose of the bot utterance.# Trigger the bot to inform about something flow bot inform $text # Trigger the bot to ask something flow bot ask $text # Trigger the bot to express something flow bot express $text # Trigger the bot to respond with given text flow bot respond $text # Trigger the bot to clarify something flow bot clarify $text # Trigger the bot to suggest something flow bot suggest $text
Bot Event Flows#
- bot started saying $text
Wait for the bot starting with the given utterance
Example:
- bot started saying something
Wait for the bot starting with any utterance
Example:
- bot said $text
Wait for the bot to finish saying given utterance
Example:
- bot said something -> $text
Wait for the bot to finish with any utterance
Example:
Semantic variants
You may react to specific semantic wrappers for
bot say
that are defined in thecore.co
library# Wait for the bot to finish informing about something flow bot informed something -> $text # Wait for the bot to finish asking about something flow bot asked something -> $text # Wait for the bot to finish expressing something flow bot expressed something -> $text # Wait for the bot to finish responding something flow bot responded something -> $text # Wait for the bot to finish clarifying something flow bot clarified something -> $text # Wait for the bot to finish suggesting something flow bot suggested something -> $text
Utilities#
- wait indefinitely
Helper flow to wait indefinitely. This is often used at the end of the
main
flow to make sure the interaction is not restarted.Example:
- it finished
Wait until a flow or action has finished. This will also check the action’s or flow’s state and if it has already finished, continue immediately. If the awaited flow has already failed instead of finished, this flow will also fail.
Note: Actions can never fail, even if stopped, but will always finish. If an action was stopped, the ActionFinished event will have a
was_stopped=True
argument.Example:
State Tracking Flows#
These are flows that track bot and user states in global variables.
- tracking bot talking state
Track bot talking state in global variable
$bot_talking_state
,$last_bot_script
.Example:
- tracking user talking state
Track user utterance state in global variables:
$user_talking_state
,$last_user_transcript
.Example:
Development Helper Flows#
- notification of colang errors
A flow to notify about any runtime Colang errors
Example:
- notification of undefined flow start
A flow to notify about the start of an undefined flow
Example:
- notification of unexpected user utterance
A flow to notify about an unhandled user utterance
Example: