top of page

​Chatbots with simple AI


In this project, I made a Chatbot about ordering milk tea to simulate a simple AI ordering segment. I wanted to do this topic for milk tea because when I order milk tea using a takeaway app, I usually encounter a lot of options on the home page, which always causes me confused as to which one to choose and also takes me a long time. So I thought if the user is provided with options in the form of Chatbot questions, the process of ordering milk tea will become much easier.

Creative Tech的副本.jpg




1. Use the theory of the Binary Tree to set up the problem of ordering milk tea. This process has a total of five questions for the user to choose from, so this Binary tree has five levels.


2. In this class, I mainly provide two options for the problem in the Binary Tree above, for example, I added "regular sweetness" and "no sweetness" to the question.


3. In this class, the last "confirm" question is set differently so that no next round of choices will appear for this question compared to the previous choices. So when the user selects "yes", "Thanks for the order" will appear, and then all the options selected by the user will be summarized by the variable {orderstr}. When the user selects "No", the first option is replayed and the user starts the selection again.


4. This paragraph defines the flow of the entire code. Starting from "hi bobo" to the first question and providing the first choice with "YesNoView". next, the second to last question is asked by repeated calls to "ask Question " to ask the second to last question in sequence. Finally, let the user confirm his final choice with "CorrectOrNot".

Final display 

The selected option will appear when the user finally selects "yes".

When the user finally selects "No", the user will be returned to the beginning and will need to re-enter "hi bobo" to continue the order.

bottom of page