Skip to content

IBM/SAP-Conversational-AI-To-Watson-Assistant-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SAP-Conversational-AI-To-Watson-Assistant-Converter

This project includes a convertor which is basically a python script that can convert SAP CAI project to Watson Assistant project.

Writing an entire chatbot on a new system needs lot of efforts, hence this convertor is implemented with the purpose of making this process semi-automated.

Prerequisite

  • A latest version of python needs to be installed. (Version used for creating this tutorial was Python 3.10.8)

At present the convertor supports converting

  1. Intents
  2. Entities
  3. Basic Skill structure (Dialog in Watson Assistant)
  4. Main webhook

SAP CAI Project Structure:

This tutorial focuses on a simple chatbot and the images shown below can be used as a reference for actual CAI chatbot. Login to SAP CAI and select the chatbot project which needs to be migrated. Website: https://cai.tools.sap

Intents:

intentSAP

Entities:

entitySAP

Skills:

skillSAP

Export and download Project.

  • Click on the export button as shown in the image below to export the CAI chatbot

projectexportSAP

  • Once the export process is completed we can download the project to our system

projectdownloadsap

Edits to be done in convertor script:

Step 1: Open the File convertor.py

Step 2: In mainFun(), replace inputFileLoc with the absolute path of the root directory for SAP CAI project which was downloaded previously.

Ex. inputFileLoc = “/users/Downloads/SAPCAI-project”

Similarly mention the outputFileLoc with the absolute path where the converted watson assistant project needs to be saved.

Ex. outputFileLoc = “/users/Downloads”

pythonfilechange

Step 3: On the terminal(or the preferred IDE) execute the python script.

$ python3 convertor.py

Output file for Watson Assistant project is now generated.

outputfile

Watson Assistant:

Step 1: Login to IBM cloud and create a Watson Assistant instance.

Step 2: Launch the Watson assistant.

Since this is an empty project there won’t be any intent, entity or dialog available.

Intent:

emptyintentWA

Entity:

emptyentityWA

Dialog:

emptydialogsWA

  • Click on upload/download and select the file which was created as an output by convertor.

selectgeneratedfileWA

  • Press upload button, then press upload and replace.

pressuploadWA

uploadandreplaceWA

  • If successfully uploaded, we will get status as shown in the image below.

successfullyuploaded

Let us check if data is migrated successfully.

Intents:

intentmigratedWA

Entities:

entitiesmigratedWA

Dialog:

dialogmigratedWA

Webhook:

webhooksmigratedWA

Summary

This completes the tutorial on how to use the convertor script provided in this repo to migrate some of the components directly to Watson Assistant.

Next Steps

As next steps this project can now be used as a base to build and add more features on top of it to create chatbots of different use case.

Watson Assistant Documentation:

https://cloud.ibm.com/docs/assistant?topic=assistant-getting-started

About

This converter is used to convert the SAP CAI chatbot projects to Watson Assistant

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages