Building Workflow
A Simple Agent Example
In Pro Config, a workflow is a cascade of multiple Modules that can perform a series of tasks. In this chapter, we will build a simple agent that involves the cascade of two Modules.
In the agent above, we define the variable user_message
of type IM
(Instant Messaging). This allows the agent to take input in the form of messages sent to the agent. In the above example, we have set a transition on event CHAT
to point to chat_page_state
. So, whenever a user sends a message in the chat, the state is reloaded and the message is taken as in IM
input.
This user_message
is then passed into the tasks.
Configuration of Each Module
Tasks contain multiple modules that execute sequentially. For each module, we need to specify the module_type
and module_config
. Rather, name
is optional (for readability). In the example above, we include a GPT-3.5 LLM widget and a TTS widget provided on MyShell.
Specifically, after clicking the "workshop" button on the left menu bar, you will see this widget center. On the very top selection bar, select "TTS". Then pick your favorite voice model, use the "more" button to copy the widget ID, and paste into the config file.
Render and Transitions
After the execution of the tasks, two variables called reply
and reply_voice
are obtained and ready to be rendered in a message that would appear in the User Interface. We have also handled a special event called CHAT
in the transitions, which means when a user sends a message, the automata will jump into chat_page_state
and execute that state. In the next section, we will describe how to handle and use different types of transitions.
Last updated