SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Use Scripting to Design a Chatbot Message from an API Response

Create an SAP Conversational AI chatbot for customer ordering by calling an API and using scripting to create a custom message from the response.

Overview

🎓 beginner 30 min. SAP Conversational AiBeginnerSAP Business Technology Platform

You will learn

  • โœ”How to fetch entity values with an external (OData) service
  • โœ”How to build a custom message using scripting
  • โœ”How to create a button that lets the end user trigger a skill
Unknown U Unknown November 4, 2022
Created by September 22, 2021
Contributors

Prerequisites

Prerequisites

Steps

Intro

You will build a bot so customers can order a product from categories like food, beverages or electronics – simulating a convenience store digital commercial chatbot. Here’s a sneak peek:

botโ€™s sneak peek
botโ€™s sneak peek

To build the bot, you start by creating an intent for ordering a product, which then gives the customer a dynamically generated list of products depending on the category the customer chose. This is done by calling an OData service.

The main purpose of this tutorial is to demonstrate how to make API requests and handle the responses with scripting. Scripting enables you to show the content the user is asking for in different UI elements (e.g., Cards or Buttons).


Step 1 Create new bot and intent
โ€”

  1. Go to SAP Conversational AI and log in.

  2. Click New Bot and select the following:

    Field NameValue
    1. What do you want your chatbot to do?Perform Actions
    2. Predefined SkillsGreetings
    3. Create your bot
    • Name: bestrunbot
    • Description: A bot to help customers order a product
    • Language: English
    4. Data PolicyNon-personal, Store data and Non-vulnerable
    5. Bot VisibilityPublic

    Create bot
    Create bot

    Click Create a Bot.

  3. Go to the Train > Intents tab, and create an intent.

    Call the new intent categoriesforsale and click Create Intent.

    Create intent
    Create intent

  4. Open the intent and add the following expression: See Categories for Sale.

    Add an expression
    Add an expression

Step 2 Create entities
+
Step 3 Create skill for ordering
+
Step 4 Add category requirement for skill
+
Step 5 Add product requirement for skill
+
Step 6 Create skill for checkout
+
Step 7 Let user trigger checkout skill
+
Step 8 Add actions to checkout skill
+
Step 9 Modify greetings skill to ask about ordering
+
Step 10 Test bot
+
Step 11 Test yourself: scripting syntax
+
Step 12 Test yourself: custom messages
+
Step 13 Now you've learned:
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 13
1. Create new bot and intent 2. Create entities 3. Create skill for ordering 4. Add category requirement for skill 5. Add product requirement for skill 6. Create skill for checkout 7. Let user trigger checkout skill 8. Add actions to checkout skill 9. Modify greetings skill to ask about ordering 10. Test bot 11. Test yourself: scripting syntax 12. Test yourself: custom messages 13. Now you've learned:

Learn more →