2020/11/9 Assignment 2: Building a dental clinic system using a chatbot and dockerized services | COMP9322 20T3 | WebCMS3 https://webcms3.cse.unsw.edu.au/COMP9322/20T3/resources/54760 1/9 Resources / Assignments (/COMP9322/20T3/resources/51695) / Week 7 (/COMP9322/20T3/resources/51697) / Assignment 2: Building a dental clinic system using a chatbot and dockerized services Assignment 2: Building a dental clinic system using a chatbot and dockerized services Business Scenario In this assignment, you implement a Chatbot that rely on a set of REST API based services to perform booking in a dental clinic. First, let us imagine that the appointment booking operation in the dental clinic is based on the following workflow (modelled as state machines). The scenario here is the patient contact the Chatbot to request for a booking. If the patient needs to specify the doctor or ask for the list of doctors available. After the selection of the dentist the patient needs to specify the preferred timeslot the chatbot checks if the timeslot is available and if not, it provides list of available timeslots. The patient will select one of the available timeslots and the booking is made. The assumption is that we have at least three dentists. They are available from 9AM-5PM every day. Each dentist by nature has a timetable. The specification are deliberately left open to allow students to take follow their own strategy to achieve the required outcome. You are allowed to use any of three approaches (Rule, ML, Flow) to build your chatbot. API Implementation (5 Marks) System overview Specification Make Submission Check Submission Collect Submission 2020/11/9 Assignment 2: Building a dental clinic system using a chatbot and dockerized services | COMP9322 20T3 | WebCMS3 https://webcms3.cse.unsw.edu.au/COMP9322/20T3/resources/54760 2/9 The diagram above shows the high level components of the system you are building. The Dentist and Timeslot services are to be deployed in a docker container and the chatbot should communicate with the services through REST API calls. To summarise the main functionalities: Get available dentists Get dentist information Get available timeslots for each dentist Reserve timeslot Cancelling appointment The following describes the API you should implement. The resources and their URI patterns: There are two types of resources to be managed: Dentist and Timeslot. It is up to you to design these resources and their URI patterns. Indeed, this will be your first task. Go through the scenario and make sure that you have every piece of data needed to service the scenario is covered. Some suggested information for each resource: Dentist: name, location, specialization (e.g., Paediatric Dentistry, Orthodontics, Oral Surgery…etc.) Timeslots: 1 hour timeslots from 9:00 AM to 5:00 PM, status flag (reserved, available) Managing resources: It is important that all HTTP methods implemented by you satisfy the safety and idempotency properties of REST operations. It is also important that the design of the API allow stateless communications. It is part of your design task to choose an appropriate HTTP method to implement the following management operations. Persisting resources: Ideally, you would like to store these data in a persisting data source. Since our dental clinic system have separate services (Dentist, Timeslot) for different functionalities, you need to make sure these services are isolated (all the communications/data exchanges between them are via REST APIs). The form and type of data is up to the students to decide. RESTful APIs are stateless: Your implementation of APIs should show that your APIs are stateless and all communications are self- contained with the messages. 2020/11/9 Assignment 2: Building a dental clinic system using a chatbot and dockerized services | COMP9322 20T3 | WebCMS3 https://webcms3.cse.unsw.edu.au/COMP9322/20T3/resources/54760 3/9 Chatbot Interaction (13 Marks) There is no special requirement which chatbot or messaging platform to use but here are some general guidelines you need to follow. The bot should be able to respond to basic greetings. The bot asks the client for the preferred doctor and provide information about the doctor. The bot can list all the available doctors in the clinic and the client can choose. The bot can check if the selected timeslot is already reserved and suggest another timeslot. The bot can provide a list of available timeslots for the selected doctor. The bot can confirm the booking and summarize at the end. The bot can cancel the booking if the client requested it and ask for confirmation. Interaction between user and chatbot is happening in an interface. Thus, a front-end (even very basic one) is required. From end-users perspective, swagger and/or terminal interfaces are not something that they would expect to use. Please note that you are NOT allowed to use any messaging app (Facebook Messenger, Telegram, WeChat, Slack, etc) as front-end, you need to make your own front-end even very basic one (e.g. simple html page). Documentation (2 Marks) Provide some deployment and usage instructions in a form of PDF file. Use Swagger to document all of your endpoints and their sample input and output. Notes: Put all the files (code, documentation, etc) in a zip/tar file named with your zid (e.g., z1234567.zip) Do not plagiarize (files will be checked for similarities) Late Submission Penalty: 25% per day (up to 3 days) Plagiarism This is an individual assignment . The work you submit must be your own work. Submission of work partially or completely derived from any other person or jointly written with any other person is not permitted. The penalties for such offence may include negative marks, automatic failure of the course and possibly other academic discipline. Assignment submissions will be examined manually. Do not provide or show your assignment work to any other person - apart from the teaching staff of this course. If you knowingly provide or show your assignment work to another person for any reason, and work derived from it is submitted, you may be penalized, even if the work was submitted without your knowledge or consent. Pay attention that is also your duty to protect your code artifacts . if you are using any online solution to store your code artifacts (e.g., GitHub) then make sure to keep the repository private and do not share access to anyone. Reminder: Plagiarism is defined as (https://student.unsw.edu.au/plagiarism) using the words or ideas of others and presenting them as your own. UNSW and CSE treat plagiarism as academic misconduct, which means that it carries penalties as severe as being excluded from further study at UNSW. There are several on-line sources to help you understand what plagiarism is and how it is dealt with at UNSW: Plagiarism and Academic Integrity (https://student.unsw.edu.au/plagiarism) UNSW Plagiarism Procedure (https://www.gs.unsw.edu.au/policy/documents/plagiarismprocedure.pdf) 2020/11/9 Assignment 2: Building a dental clinic system using a chatbot and dockerized services | COMP9322 20T3 | WebCMS3 https://webcms3.cse.unsw.edu.au/COMP9322/20T3/resources/54760 4/9 Resource created 15 days ago (Sunday 25 October 2020, 12:04:26 PM), last modified 13 days ago (Monday 26 October 2020, 11:02:22 PM). Make sure that you read and understand these. Ignorance is not accepted as an excuse for plagiarism. In particular, you are also responsible for ensuring that your assignment files are not accessible by anyone but you by setting the correct permissions in your CSE directory and code repository, if using one (e.g., Github and similar). Note also that plagiarism includes paying or asking another person to do a piece of work for you and then submitting it as your own work. UNSW has an ongoing commitment to fostering a culture of learning informed by academic integrity. All UNSW staff and students have a responsibility to adhere to this principle of academic integrity. Plagiarism undermines academic integrity and is not tolerated at UNSW. Comments (/COMP9322/20T3/forums/search?forum_choice=resource/54760) (/COMP9322/20T3/forums/resource/54760) Add a comment Yifan Ai (/users/z5210859) about 12 hours ago (Sun Nov 08 2020 21:45:36 GMT+0800 (中国标准时 间)), last modified about 12 hours ago (Sun Nov 08 2020 21:48:14 GMT+0800 (中国标准时间)) Hi Shayan/Morty, In Timeslot, "1 hour timeslots from 9:00 AM to 5:00 PM, status flag (reserved, available)". Are reservations made to the same date? Or do I need to record the reservation date? Will I get marks deducted if I assume this is a same-day or next-day reservation service? Thank you in advance! Reply Sophia Lev (/users/z5178140) about 18 hours ago (Sun Nov 08 2020 16:16:14 GMT+0800 (中国标准 时间)) Hi, are we allowed to use DialogFlow? Reply Shayan Zamanirad (/users/z5089130) about an hour ago (Mon Nov 09 2020 09:17:58 GMT+0800 (中国标准时间)) Hi Sophia, Yes you can, since we talked about DialogFlow vs Wit.ai in the course. Reply 2020/11/9 Assignment 2: Building a dental clinic system using a chatbot and dockerized services | COMP9322 20T3 | WebCMS3 https://webcms3.cse.unsw.edu.au/COMP9322/20T3/resources/54760 5/9 Usman Haidar (/users/z5062617) about 19 hours ago (Sun Nov 08 2020 15:26:07 GMT+0800 (中国标 准时间)) Hi Shayan/Morty, So for "getting all available doctors" does that mean list of all doctors in the clinic regardless of the time, or all doctors that are currently available in the present time ie datatime.now() ? Kind Regards, Usman Reply Cavinash Chelliah (/users/z3417347) about 20 hours ago (Sun Nov 08 2020 14:19:08 GMT+0800 (中 国标准时间)), last modified about 20 hours ago (Sun Nov 08 2020 14:19:31 GMT+0800 (中国标准时间)) Hi for the paths between the chatbot and the user is there any need to have multiple paths. I.e. is GET path sufficient to get user input and then to filter intents locally or is there any advantage to also having a POST path to use for example request a particular booking. From what I can see there is no particular advantage to this? Reply Shayan Zamanirad (/users/z5089130) about 18 hours ago (Sun Nov 08 2020 15:47:36 GMT+0800 (中国标准时间)) Hi Cavinash, This is a design decision and you need to consider the principals we talked in the lectures (weeks 1 and 2). Reply Cavinash Chelliah (/users/z3417347) about 21 hours ago (Sun Nov 08 2020 13:34:02 GMT+0800 (中 国标准时间)) Hi, do we need to setup YAML and codegen files for all three components or can we just setup our api requests to the two docker services normally and use codegen/YAML for the main service only? Reply Shayan Zamanirad (/users/z5089130) about 18 hours ago (Sun Nov 08 2020 15:50:20 GMT+0800 (中国标准时间)) Hi Cavinash, You need to have setups for all components. Reply Cavinash Chelliah (/users/z3417347) a day ago (Sat Nov 07 2020 21:13:19 GMT+0800 (中国标准时 间)), last modified about 18 hours ago (Sun Nov 08 2020 15:57:19 GMT+0800 (中国标准时间)) Hi Morty/Shayan, I am having some difficulty figuring out how to send the API call to docker. Basically, the path works in the browser but I can't make the call through Flask. 2020/11/9 Assignment 2: Building a dental clinic system using a chatbot and dockerized services | COMP9322 20T3 | WebCMS3 https://webcms3.cse.unsw.edu.au/COMP9322/20T3/resources/54760 6/9 I am trying to make a call like this which is the same as what I run through the browser. Could you please advise? Reply Usman Haidar (/users/z5062617) a day ago (Sat Nov 07 2020 19:59:38 GMT+0800 (中国标准时间)) Hi Morty/Shayan, Since the services run on two different docker containers, would that mean there is going to be two different swagger files? I am using codegen to generate one codebase for dentist_service.yaml, and another to generate a codebase for timeslot_service.yaml. Each have a different call to their respective swagger files. Kind Regards, Usman Reply Shayan Zamanirad (/users/z5089130) a day ago (Sat Nov 07 2020 20:51:24 GMT+0800 (中国标 准时间)) Hi Usman, Yes that's correct, they have separate/different swagger files as they are separate services. Reply Usman Haidar (/users/z5062617) a day ago (Sat Nov 07 2020 23:57:44 GMT+0800 (中国标准 时间)) Thanks shayan, my follow up question is does the swagger file need to be live and running like we have presented in the labs, or is a simple static yaml (like assignment 1) enough ? Reply Shayan Zamanirad (/users/z5089130) about 18 hours ago (Sun Nov 08 2020 15:51:38 GMT+0800 (中国标准时间)) No sure what do you mean by "simple static yaml"? Reply Dongshuo Jiang (/users/z5129378) a day ago (Sat Nov 07 2020 19:22:49 GMT+0800 (中国标准时间)) How many dockers do we need to build? From my point of view, we have to use three dockers. One is dentist service, one is timesolt service and one is the NLP which is to determine which service should i use. Also, dentist service and timesolt service are stateless 2020/11/9 Assignment 2: Building a dental clinic system using a chatbot and dockerized services | COMP9322 20T3 | WebCMS3 https://webcms3.cse.unsw.edu.au/COMP9322/20T3/resources/54760 7/9 but NLP should record the status of the user. For example, the NLP service has to receive both cancel and cancel confirmation and then send a cancel request to timeslot service. Is that right? Reply Shayan Zamanirad (/users/z5089130) a day ago (Sat Nov 07 2020 20:49:53 GMT+0800 (中国标 准时间)) Hi Dongshuo, We need two dockers (system overview architecture in the assignment spec), but why not, you can run the chatbot inside another container which is more professional design. Reply Sachin Krishnamoorthy (/users/z5232031) 2 days ago (Fri Nov 06 2020 22:45:44 GMT+0800 (中国标 准时间)) Hello, I wanted to clarify a point regarding stateless communication. Since the user specifies the dentist they want to visit as well as the appointment time in different messages, the chatbot will need to record the initial dentist specification in between finalizing the appointment. From the specs here: "It is important that all HTTP methods implemented by you satisfy the safety and idempotency properties of REST operations. It is also important that the design of the API allow stateless communications." I take it that this means we cannot use cookies, or the "sessions" that flask has built in? Are we allowed to write to a temporary file to track which dentist the user wants before finalizing the appointment? Thanks! Reply Shayan Zamanirad (/users/z5089130) a day ago (Sat Nov 07 2020 20:45:07 GMT+0800 (中国标 准时间)) Hi Sachin, Good point! since you (from chatbot point of view) need to track the conversation up to the "finalising the appointment" point, you should keep the details somewhere; so, you can use a temporary file, database record, etc. It's totally up to you. Reply Sachin Krishnamoorthy (/users/z5232031) about 20 hours ago (Sun Nov 08 2020 14:42:09 GMT+0800 (中国标准时间)) Thanks Shayan! Understood. Reply 2020/11/9 Assignment 2: Building a dental clinic system using a chatbot and dockerized services | COMP9322 20T3 | WebCMS3 https://webcms3.cse.unsw.edu.au/COMP9322/20T3/resources/54760 8/9 Marhadiasha Kusumawardhana (/users/z5226934) 3 days ago (Fri Nov 06 2020 19:21:22 GMT+0800 (中国标准时间)) Hi Shayan/Morty, Is it acceptable to just use buttons for the user to do actions (Select doctor, select timeslot, book, cancel, confirm)? The buttons will still be in the chat window, and will be part of the conversation. Asking for list of doctors and greetings will still be text-based. But buttons and cards will be shown when the user is expected to do actions. Is this acceptable? Thank You Reply Shayan Zamanirad (/users/z5089130) a day ago (Sat Nov 07 2020 20:40:40 GMT+0800 (中国标 准时间)) Hi Marhadiasha, Yes you can do that, however the chatbot should still be able to handle text-based inputs as well. In other words, if user inputs the required information by text instead of clicking on the suggested button(s), the chatbot must handle the input properly. Reply Marhadiasha Kusumawardhana (/users/z5226934) a day ago (Sat Nov 07 2020 20:52:45 GMT+0800 (中国标准时间)), last modified a day ago (Sat Nov 07 2020 20:53:58 GMT+0800 (中国 标准时间)) Got It, Shayan. I designed the buttons to be a UI helper feature to put the text in the button into the text field and send the message automatically. For example, if the text in button is "Confirm", it will actually just send a message "Confirm" to the bot service. So it should works exactly the same if the user type the same text in the buttons. Thank You, Shayan. Reply Shayan Zamanirad (/users/z5089130) about 19 hours ago (Sun Nov 08 2020 15:43:29 GMT+0800 (中国标准时间)) Also, if user says something different (e.g. "Ok", "Please book it", etc), the chatbot should be able to consider it as confirmation. Reply Marhadiasha Kusumawardhana (/users/z5226934) about 18 hours ago (Sun Nov 08 2020 15:51:26 GMT+0800 (中国标准时间)) Got it. Thank you Shayan. Reply 2020/11/9 Assignment 2: Building a dental clinic system using a chatbot and dockerized services | COMP9322 20T3 | WebCMS3 https://webcms3.cse.unsw.edu.au/COMP9322/20T3/resources/54760 9/9 Load More Comments
欢迎咨询51作业君