(inputText)
| 97 | } |
| 98 | |
| 99 | async function onSendMessage(inputText) { |
| 100 | if (inputText != null && inputText.length > 0) { |
| 101 | // Add the input text to the chat window |
| 102 | const msgId = appendMessage(inputText, 'input'); |
| 103 | // Classify the text |
| 104 | const classification = await classify([inputText]); |
| 105 | // Add the response to the chat window |
| 106 | const response = await getClassificationMessage(classification); |
| 107 | appendMessage(response, 'bot', msgId); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | let messageId = 0; |
| 112 | function appendMessage(message, sender, appendAfter) { |
no test coverage detected