@cognigy/rest-api-client
Version:
Cognigy REST-Client
44 lines • 1.5 kB
JavaScript
import { __awaiter } from "tslib";
/* Custom modules */
import { createNodeDescriptor } from "../../createNodeDescriptor";
/**
* Node name: 'regexSlotFiller'
*
* Purpose:
* Fills slots dynamically by evaluating a custom regular expression
*/
export const REGEX_SLOT_FILLER = createNodeDescriptor({
type: "regexSlotFiller",
defaultLabel: "Regex Slot Filler",
summary: "UI__NODE_EDITOR__NLU__REGEX_SLOT_FILLER__SUMMARY",
appearance: {
showIcon: false
},
fields: [
{
key: "regex",
type: "cognigyText",
label: "UI__NODE_EDITOR__NLU__REGEX_SLOT_FILLER__FIELDS__REGEX__LABEL",
description: "UI__NODE_EDITOR__NLU__REGEX_SLOT_FILLER__FIELDS__REGEX__DESCRIPTION",
defaultValue: ".*"
},
{
key: "flags",
type: "cognigyText",
label: "UI__NODE_EDITOR__NLU__REGEX_SLOT_FILLER__FIELDS__FLAGS__LABEL",
defaultValue: "gi"
},
{
key: "slot",
type: "cognigyText",
label: "UI__NODE_EDITOR__NLU__REGEX_SLOT_FILLER__FIELDS__SLOT__LABEL"
},
],
tags: ["ai", "nlu", "regular", "expression", "slot"],
function: (regexSlotFillerParams) => __awaiter(void 0, void 0, void 0, function* () {
const { cognigy, config } = regexSlotFillerParams;
const { api } = cognigy;
api.setRegexSlot(regexSlotFillerParams);
})
});
//# sourceMappingURL=regexSlotFiller.js.map