msakibhr / state-machine

A finite state machine for chatbots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

State Machine

This is a state machine for chatbots which rely on user input to determine the reponse.

eg:
User> Hi
Bot> Hello, what do you want?
1. Fried rice
2. Chicken
3. Dumplings
4. Something else

User> 1
Bot> You want fried rice? Choose drink:
1. Coke
2. Pepsi
3. Orange Juice
4. Water
5. Apple Juice

User> 5
Bot> You will get your fried rice with apple juice in 5 mins.

In the above scenario, the user had multiple options and it can be difficult to keep track of. The solution to this issue, is to use a state machine. This is an example of a state machine that can be used for such.

NB: It's not perfect, but for what I wanted, it worked so 🤷‍♂️

About

A finite state machine for chatbots


Languages

Language:Python 100.0%