Transitions
{
"type": "automata",
"id": "transition_demo",
"initial": "home_page_state",
"transitions": {
"go_home": "home_page_state"
},
"states": {
"home_page_state": {
"render": {
"text": "Click 'Start' to chat!",
"buttons": [
{
"content": "Start Chat",
"description": "Click to Start Chatting.",
"on_click": "start_chat"
}
]
},
"transitions": {
"start_chat": "intro_message_state"
}
},
"intro_message_state": {
"render": {
"text": "Hi, welcome to the Pro Config tutorial. How can I assist you today?",
"buttons": [
{
"content": "Home",
"description": "Click to Go Back to Home.",
"on_click": "go_home"
}
]
},
"transitions": {
"CHAT": "chat_page_state"
}
},
"chat_page_state": {
"inputs": {
"user_message": {
"type": "IM",
"user_input": true
}
},
"tasks": [
{
"name": "generate_reply",
"module_type": "AnyWidgetModule",
"module_config": {
"widget_id": "1744214024104448000", // GPT 3.5
"system_prompt": "You are a teacher teaching Pro Config.",
"user_prompt": "{{user_message}}",
"output_name": "reply"
}
},
{
"name": "generate_voice",
"module_type": "AnyWidgetModule",
"module_config": {
"widget_id": "1743159010695057408", // TTS widget (Samantha)
"content": "{{reply}}",
"output_name": "reply_voice"
}
}
],
"render": {
"text": "{{reply}}",
"audio": "{{reply_voice}}",
"buttons": [
{
"content": "Home",
"description": "Click to Go Back to Home.",
"on_click": "go_home"
}
]
},
"transitions": {
"CHAT": "chat_page_state"
}
}
}
}
State Transition Process In the Above Example
Transition & Its Attributes
The Scope of Transitions
Conditional Transitioning
Last updated