From the course: Building Bots with Node.js

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Implementing a conversation service

Implementing a conversation service - Node.js Tutorial

From the course: Building Bots with Node.js

Start my 1-month free trial

Implementing a conversation service

- [Instructor] When doing a reservation, it's common that we don't provide all needed information with one utterance. We expect the operator to ask for missing data. To accomplish that with a bot, we have to store what we know already and create follow-up questions that prompt the user for more information. We will now build the infrastructure for that into a new service and I call it conversation service. So in services I will now create a new file. ConversationService.js. And there start out with class conversation service and let's export it right away. And in there I will now create a static function. So all functions of the service will be static because the service itself will not hold any state itself. So I'm adding static async run and this function should get the witService. So for natural language processing, the actual text and also context object. We know that this comes from the session management we already…

Contents