top of page

​Chatbots with simple AI

​Brief

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

​Diagram

​Process

P1.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.

P2.jpg

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.

P3.jpg

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.

P4.jpg

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".

​Error and resolve: From the "if" sentence, in the beginning, I delete the (node. yes and node. no and node. yes. yes and node. no.no and node.), but I can't run the coding. So I think I can't only keep the  (yes.yes.yes and node. no. no) because I should type all of the orders of yes.no and keep the hierarchy to make sure the code can run.

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