Leveraging the knowledge base in the WAL language
Before we embark on encoding chatbot automation, let’s look at using the knowledge base with non-chatbot commands so that we can see it in action without having to do the configuration. We will leverage the answerQuestion
command, and we’d expect the same behavior as we observed using the knowledge base training tool:
defVar --name chatHistory --type String defVar --name answer --type String defVar --name success --type Boolean answerQuestion --kb vetClinic --minimumscore 500 -- botHistoryMessageId "${chatHistory}" --culture "en-US" -- text "What hours are you open?" answer=answer success=success logMessage --message "The answer is ${answer}. Success: ${success}" --type "Info"
After executing the example command, we’ll see that the script log indicates the following:
3/15/2022 5:43:50 AM - [Info] The answer is The Vet Clinic is open Monday-Friday...