@cognigy/rest-api-client
Version:
Cognigy REST-Client
52 lines • 1.67 kB
JavaScript
import { __awaiter } from "tslib";
/* Custom modules */
import { createNodeDescriptor } from "../../createNodeDescriptor";
/**
* Node name: 'addLexiconKeyphrase'
*
* Purpose:
* Adds a keyphrase to a lexicon
*/
export const ADD_LEXICON_KEYPHRASE = createNodeDescriptor({
type: "addLexiconKeyphrase",
defaultLabel: "Add Lexicon Keyphrase",
summary: "UI__NODE_EDITOR__NLU__ADD_LEXICON_KEY_PHRASE__SUMMARY",
appearance: {
showIcon: false
},
fields: [
{
key: "lexiconId",
type: "cognigyText",
label: "UI__NODE_EDITOR__NLU__ADD_LEXICON_KEY_PHRASE__FIELDS__LEXICONID__LABEL",
params: {
required: true
}
},
{
key: "keyphrase",
type: "cognigyText",
label: "UI__NODE_EDITOR__NLU__ADD_LEXICON_KEY_PHRASE__FIELDS__KEYPHRASE__LABEL",
params: {
required: true
}
},
{
key: "slots",
type: "textArray",
label: "UI__NODE_EDITOR__NLU__ADD_LEXICON_KEY_PHRASE__FIELDS__SLOTS__LABEL"
},
{
key: "synonyms",
type: "textArray",
label: "UI__NODE_EDITOR__NLU__ADD_LEXICON_KEY_PHRASE__FIELDS__SYNONYMS__LABEL"
}
],
tags: ["data", "nlu"],
function: ({ cognigy, config }) => __awaiter(void 0, void 0, void 0, function* () {
const { api } = cognigy;
const { lexiconId, keyphrase, slots, synonyms } = config;
yield api.addLexiconKeyphrase(lexiconId, keyphrase, slots, synonyms);
})
});
//# sourceMappingURL=addLexiconKeyphrase.js.map