Now that the app has the search terms “movie”, “western”, “English”, and “2010-2018”, it’s ready to send a search request to the movie database. This line gets the “interval” entity, which contains “2010-2018”:.This line gets the “language” entity, which contains “English”:.This line gets the “genre” entity, which contains “Western”:.This line gets the “recording“ entity, which contains “movie”:.The following lines of code get each entity and its value: The entities in the conversation contain all the information that the Node.js app needs to send a search request to the movie database: “movie”, “Western”, “English”, and “2010-2018“. In the variable “conversation”, the app now has the entities and their values in a format that it can read and crawl through. To get the information it needs, the app must access the conversation that’s stored in the SAP Conversational AI memory. “app.post” just needs the name used in the bot’s webhook to know which bot it’s talking with. The app listens for any requests from SAP Conversational AI by using the statement “app.post.” Now that it knows where to find the Node.js app, SAP Conversational AI can send it information and request information, as though the app is a web server. In this example from the Movie Bot, SAP Conversational AI finds the entities #RECORDING, #GENRE, #LANGUAGE, and #INTERVAL from a conversation with the user: The app can use them to submit a search to the movie database. The Node.js app needs to connect to the SAP Conversational AI chatbot to get the entities and their values that SAP Conversational AI found in the conversation with the user. Note: To keep it simple, instead of showing full lines of code, the code samples here show just enough to indicate what the Node.js application is doing. Send a text response along with the movie recommendation.Receive and send the movie recommendation.Send the answer to the SAP Conversational AI chatbot Send the movie genre ID and other search criteriaĥ.Get the search terms using the entities found in the conversation Then, continuing with the Movie Bot tutorial example, we’ll see how the movie bot’s Node.js application does the following:ģ. Like Part 1, Part 2 takes a high-level glance at the process and leaves how-to details to other SAP Conversational AI tutorials.įirst, we’ll look at a couple of tasks that most Node.js applications do when working with SAP Conversational AI chatbots: In this blog post, we’ll see how a Node.js application can search for information, based on a conversation in an SAP Conversational AI chatbot. In Part 1, we looked at what Node.js is and how SAP Conversational AI connects to a Node.js application. If a non-programmer like me can learn something about Node.js, so can you! If you aren’t a developer, but you were able to make it through Demystifying Node.js for SAP Conversational AI Bot Builders, Part ll promises to be no more technical.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |