Combines and merges seperate IBM Watson Assistant Dialog Skill into one; integrates intents, entities and dialog contents of one skill with another without one overriding the other.
A feature currently not possible with IBM Watson Cloud Assistant Service. Program merges two seperate Watson Skills into One.
Folder groupings and Dialogue (Dialog Trees with children) are also kept intact.
DialogNodes with the same DialogIDs are renamed. All intents are merged into one User is expected to manually review the merged Skills upon reupload to IBM Cloud.
2 Valid JSON files (possibly exported) from IBM Watson Assistant, JSON file locations to be used as app arguments.
No external NodeModules are required, hence no download or Internet connection required to run program. Merges 2 Wastson Assistant Skills exported from Watson Assistant without overriding the other. A feature currently not possible with IBM Watson Cloud Assistant Service
Validation is done ahead of the skillMerging process. JSON Format validation checking is done, as well as additional checks to ensure JSON structure follows a typical exported skill from Watson Assistant.
How it works
- Check that both skills files are JSON
- Checks for properties usually found in exported Watson Assistant Skills e.g. workspaceId, skillID etc.
- Merges Skill2 to Skill1
- Copy or merge intents and entities in skill1 and skill2
- Merge Dialogs in skill1 and skill2
- Rename duplicates/conflicts
- Generates a newly merged skill which can be reuploaded to IBM Cloud.
assistantSkillsMerger.js - Does the actual merging. one can download the "assistantSkillsMerger.js" and call the "combineWatsonSkills" function to merge 2 seperate Assistant skills.
fileValidator.js - 2 components: 1 validating JSON and the other ensuring Watson skill is valid.
index.js - Application entry point.
controller.js - Act as the application controller/scheduler, runs the validation check, consequently the merger.
How-To using Node Package Manager (NPM)
Create a new js file i.e. myApp.js
Create an app
var app = require('watson-assistant-skills-merger');
- Set the locations of the files to be merged
var file1 = require('./sample-skills-files/skill-SkillOne'); //Location of your skill1 var file2 = require('./sample-skills-files/skill-SkillTwo'); //Location of your skill2
- Call the app main function
- install the NPM packages using
npm install --save watson-assistant-skills-merger
- Run your app e.g. "node myApp.js".
Your myApp.js should look identical to the folowing:
var app = require('watson-assistant-skills-merger'); var file1 = require('./skill-SkillOne'); //Location of your skill1 var file2 = require('./folder/skill-SkillTwo'); //Location of your skill2 app(file1, file2);
Setting Watson Assistant pricing plans
You can configure the type of Watson plan in the settings.json file. You can set the value to plan "lite" or "business".
- Tomiwa Ogunbamowo - Tomiwa's GitHub
SemVer was used for versioning. SemVar Versioning (MAJOR.MINOR.PATCH)