Chatbot KT
Session | Topic | Details |
---|---|---|
1 | Chatbot Repos(Sunbird & partner-private) |
|
2 | Configuration changes - |
|
3 | Chatbot client |
|
4 | Chatbot router |
|
5 | Rasa |
|
Session 1:
Topic:
Chatbot Repos for backend and client
Details:
Repository
Backend repository https://github.com/project-sunbird/sunbird-bot
Client repository https://github.com/project-sunbird/sunbird-bot-client
Chatbot workflow
As shown in above diagram user request comes from chatbot widget either it is numeric or non-numeric
There are two types of communication flow with the chatbot
Numeric known as Menu Driven
Non-numeric known as Free Flow
router/appRest.js will take user input and decide whether it's menu-driven or Free flow conversation and according to that it will process the request
If It is Menu driven (Numeric) then the request will handle by node js itself by checking steps in chatflow.js and find the response from literals.js and sent back to the response.
If it is Free flow (Non-numeric) then it will redirect the request to Rasa backend and it will decide intent from nlu.md and decide utter_response from domain.yml (here rasa will apply its BOW algorithm) and send back to node API to return the response to chatbot widget
{Reference documents}
Comments(Action items):
Deployment diagram
Session 2:
Topic:
Configuration changes
Details:
For menu-driven logic, there are configuration files that hold Steps and responses.
config/chatflow.js : This file is having the chat flow steps json, When you need to change any step or you need to add any step on the bot you need to update the file accordingly, This file stores the json which will have the key as a step and value as that step response constant. This constant is declared in the literals.js file.
config/literals.js: This is a file that contains the response constants and their values of that constant.
Below is an example of how chatbot will discover response for menu-driven queries
user launch chatbot so it is a step1 now needs to find steps in chatflow.js and it will return response key, so on step1 message key is START,
Now it will go in literals.js and find a message.START and return that object as a response
chatflow.jsstep1: { messageKey: "START", responseVariable: "userIntent" }, step1_error: { messageKey: "UNKNOWN_OPTION", responseVariable: "" }, step1_1: { messageKey: "CHOOSE_DIGITAL_CONTENT", responseVariable: "userBoard" }, step1_2: { messageKey: "TRAINING", responseVariable: "" }, step1_2_error: { messageKey: "WRONG_INPUT_AT_FIRST_LEVEL", responseVariable: "" }, step1_2_1: { messageKey: "CHOOSE_STATE_TRAINING_BOARD", responseVariable: "" }
literals.jsmessage.START = { "type": "button", "data": { "text": " Hello, I am Tara!<br>I am your DIKSHA guide<br>Please select your preference from the options I provide or type your query directly.", "buttons": [ { "text": "Digital content", "value": "1" }, { "text": "Courses", "value": "2" }, { "text": "DIKSHA mobile app", "value": "3", }, { "text": "Content contribution", "value": "4", }, { "text": "Other DIKSHA queries", "value": "5", } ] } } message.CHOOSE_DIGITAL_CONTENT = { "type": "button", "data": { "text": " <span> What content would you like to explore?", "buttons": [ { "text": "Textbook videos & practice questions", "value": 1, }, { "text": "Critical thinking questions", "value": 2, }, { "text": "Main Menu", "value": "0", } ] } } message.TRAINING = { "type": "button", "data": { "text": " Select the course you would like to do<br>Type the number next to the course<br>", "buttons": [{ "text": "State Courses", "value": 1, }, { "text": "IGOT Courses", "value": 2, }, { "text": "NISHTHA Courses", "value": 3, }, { "text": "Go Back", "value": "99", }, { "text": "Main Menu", "value": "0", }] } }
Reference documents: https://docs.google.com/document/d/1Pej_g9Xe1ahmYHGOJWaso5_ZMjbyKtobSkgldoa_XU0/edit?usp=sharing
Comments(Action items):
When 2 or more intents found in user query/question
The same portal link should work in mobile as well.
Whatapp configuration should be the same as a menu-driven(no different deep link for mobile-specific)Refresh the configuration in all instances of Chatbot(when we have multiple instances)
Dynamic query & responses for chatbot input & output(both menu & freeflow text).
Front-end: Menu-driven object should have both portal & WhatsApp in the single object.
Write unit tests for Chatbot and enabling Circle-CI for PR merge..