IBM Developer

Tutorial

Migrate SAP Conversational AI to IBM watsonx Assistant

Use a converter developed to help with the migration of SAP Conversational AI components to watsonx Assistant, making the process easier and faster

By Niteesh Nair

SAP Conversational AI is an end-to-end chatbot building program that lets you deploy conversational AI interfaces. IBM Waton Assistant uses natural language understanding (NLU) and an integrated large language model (LLM) to better understand context so that you can deliver fast, consistent, and accurate conversational interfaces into any application, device, or channel. This tutorial steps you through the process of using a converter to migrate SAP Conversational AI components to watsonx Assistant.

The tutorial explains a converter that is basically a Python script that can convert an SAP Conversational AI project to a watsonx Assistant project. Because writing an entire chatbot on a new system requires a lot of effort, this converter semi-automates the process, making it an easier process.

Currently, the converter supports converting intents, entities, basic skill structure (called a dialog in watsonx Assistant), and the main webhook. The tutorial focuses on a simple chatbot, and you can use the following images as a reference for the actual SAP Conversational AI chatbot.

Intents

Intent SAP

Entities

Entity SAP

Skills

Skill SAP

Prerequisites

To follow this tutorial, you need:

  • The latest version of Python installed. This tutorial uses Python 3.10.8.
  • An IBM Cloud account.

Steps

Step 1. Log in to SAP Conversational AI

Log in to SAP Conversational AI, and select the chatbot project that you want to migrate.

Step 2. Export and download project

  1. Click Export, as shown in the following image, to export the SAP Conversational AI chatbot

    Project Export SAP

  2. When the export process is complete, you can download the project to your system

    Project download sap

Step 3. Edit the converter script

  1. Download and open the converter.py file.

  2. In the mainFun() command, replace inputFileLoc with the absolute path of the root directory for the SAP Conversational AI project that you downloaded previously. For example:

    inputFileLoc = “/users/Downloads/SAPCAI-project”
    
  3. Mention the outputFileLoc with the absolute path where the converted watsox Assistant project is to be saved. For example:

     outputFileLoc = “/users/Downloads”
    

    Python file change

  4. Execute the Python script on the terminal (or your preferred IDE).

    $ python3 convertor.py
    
  5. The output file for the watsonx Assistant project is generated.

    Output file

Step 4. Setting up watsonx Assistant

  1. Log in to IBM Cloud, and create a watsonx Assistant instance.

  2. Launch the watsonx Assistant instance. Because this is an empty project, there won’t be any intents, entitites, or dialogs available.

    Intent:

    Empty intent

    Entity:

    Empty entity

    Dialog:

    Empty dialog

  3. Click Upload/download, and select the file that was created as an output by the converter.

    Select generated file

  4. Click Upload, then click Upload and replace.

    Press upload

    Upload and replace

  5. If your upload is successful, you see a status like the one shown in the following image.

    Successfully uploaded

Step 5. Check whether data is migrated successfully

The following images show how your project should look if the data was migrated successfully. The intents, entities, dialogs, and webhook should have been migrated.

Intents

Intent migration

Entities

Entity migration

Dialogs

Dialog migration

Webhooks

Webhook migration

Summary

In this tutorial, you learned how to use a converter script to migrate some SAP Conversational AI components directly to watsonx Assistant.

Next Steps

You can use this project as a base to build and add more features on top of it to create chatbots for different use cases. Take a look at the watsonx Assistant documentation to learn about more watsonx Assistant features.

You can also look at watsonx Assistant demos, and book a demo yourself, to see how it works.