Welcome to the part 2 of my earlier blog post.
The expectation here is your have gone through the Part 1 of the Blog Post and if you had not you can find the link below : –
Create a CDS Entity in SAP BTP, Expose the Entity as an OData Service to Outside world, Deploy to HANA DB and CF as an application and Create a chatbot by consuming the API in SAP CAI (Part 1) | SAP Blogs
Now that you have created an API and deployed that API as a service in SAP Business Technology Platform Cloud Foundry you can consume that API from outside world in simple words from the internet.
As a Business case I decided to consume those API in SAP CAI and we see below how I created it.
Back Ground :
oAt the most basic level, a chatbot is a computer program that simulates and processes human conversation (either written or spoken), allowing humans to interact with digital devices as if they were communicating with a real person. Chatbots can be as simple as rudimentary programs that answer a simple query with a single-line response, or as sophisticated as digital assistants that learn and evolve to deliver increasing levels of personalization as they gather and process information.
o SAP Conversational AI known As SAP CAI SAP Conversational AI service is the end-to-end, low code chatbot platform designed for the enterprise. Train, build, test, connect and monitor AI-powered chatbots in a single interface to simplify user experiences and business tasks across SAP and third-party solutions.
o SAP had acquired reacst.ai through its direct French subsidiary SAP France Holding and rebranded it to SAP CAI.
o A user can create a free account in SAP CAI and can start bot building.
oSAP Business Technology Platform is a new name for the SAP cloud platform cloud foundry. Being an ERP company SAP’s focus was to create a platform, provide bunch of PaaS, SaaS services by hosting on multiple cloud vendors. Hence SAP is partnered with Azure, AWS, GCP and even Alibaba cloud and customers can host their digital enterprise system i.e., SAP S/4 HANA, HANA cloud in less time and can enjoy developing smart applications in SAP WEB IDE, SAP Business Application Studio from day 1 of their cloud implementation journey. Additional you get infrastructure support from the respective cloud vendor and SAP is fully responsible for HEC full stack managed services.
oThe chatbot is created using SPA CAI on SAP HANA cloud database instance using SAP Business Application Studio.
SAP CAI in detail
The Detailed Overview of Integrating SAP CAI with Targeted System
SAP CAI integration into the existing IT ecosystem is based on the usage of four segments: Bot builder, bot logic, NLP, and Bot connector. These all four segments blend to make SAP CAI work for an organization. Here is a detailed overview of the roles played by these four segments in SAP CAI introduction in a given IT landscape:
- NLP Engine
NLP stands for Natural Language Processing (NLP) and is used widely to assist AI in understanding the thoughts and ideas of the user despite the wrong sentence phrasing. Before NLP came into being, Chatbots used to follow a rule-based framework wherein accurate input was needed. Any inaccuracies are used to make the process cumbersome and tedious. SAP CAI uses an NLP engine that captures actionable data related to entities, user sentiments, and specific intents. It makes SAP CAI more customer-oriented.
- Bot Builder
Often referred to as a dialogue runtime, bot builder is a graphical user interface offering end-users a platform to generate effective and continual conversation flow. This is the place where businesses guide the chatbot upon a certain user request. It features a zero-code UI that speed-up the bot development process.
- Bot Logic
Hosted on SAP cloud, bot logic is a highly modernized middleware application handling jobs like calling out the OData service and providing information to SAP CAI. It fetches data from the back-end data warehouse or system.
While one is planning to integrate SAP CAI in the IT infrastructure, the use of bot logic allows developers to introduce extra-customized logic to the pre-defined bot builder logic. The best thing about bot logic is that it can be written in any language and can be used as a Web API.
we can create a new BOT using below Button.
Here you find Train Build Connect and Monito
Train : Train is where we create Intents and and under intents we can create our expressions.
Expressions are plain English language interpretations using which the NLP engine will understand the sentiments of the user and responds based on the expression.
here if you carefully see I have created @Sales and @Purchases Intents and under each Intent I had created bunch of expressions.
I want to give detailed information here so that by reading the blog post anyone can create a chatbot using SAP CAI
@Sales Intent & Expressions
@Purachses Intent & Expressions
Under Build we can create Skills.
Click on Sales Skill
Inside Sales skill we will find as in below : –
I have written a condition @sales is Present : This will be the trigger point of the chatbot.
If #SalesOrder is missing
Then ask user to enter the sales order
Then user will enter the sales order or Purchase Order which is a Number.
Once user enter sales Order or Purchase Order Number then Actions will trigger.
Now below this we will configure the API.
Please find the API response here.
SOPO is nothing but a namespace I had give here.
Same way we can do for Purchase Order.
Now Our chatbot is ready and we can run the BOT here. Also we can see the video of chatbot which I had integrated with Facebook Messenger.
Now the last is connect Button using which we can connect the chatbot to various channel as below.
Similarly you can also do CRUD operation from SAP CAI chatbot. You need to write a custom logic for the same in the middleware either in JAVA or Node JS and generate a final API end point and use that API in SAP CAI choatbot.
Hope you thoroughly understood and enjoyed the series of video.
Please go to the official website of SAP CAI and you can read the documentation which is in plain English language and easily understandable