diff --git a/packages/jovo-model-alexa/src/JovoModelAlexa.ts b/packages/jovo-model-alexa/src/JovoModelAlexa.ts index 43e5da0..785d4e8 100644 --- a/packages/jovo-model-alexa/src/JovoModelAlexa.ts +++ b/packages/jovo-model-alexa/src/JovoModelAlexa.ts @@ -330,6 +330,15 @@ export class JovoModelAlexa extends JovoModel { _set(alexaModel, 'interactionModel.dialog', _get(model, 'alexa.interactionModel.dialog')); } + // name-free interaction + if (_get(model, 'alexa.interactionModel._nameFreeInteraction')) { + _set( + alexaModel, + 'interactionModel._nameFreeInteraction', + _get(model, 'alexa.interactionModel._nameFreeInteraction') + ); + } + // types if (JovoModelHelper.hasEntityTypes(model)) { const entityTypes = JovoModelHelper.getEntityTypes(model); diff --git a/packages/jovo-model-nlpjs/src/Interfaces.ts b/packages/jovo-model-nlpjs/src/Interfaces.ts index abff889..ff218b1 100644 --- a/packages/jovo-model-nlpjs/src/Interfaces.ts +++ b/packages/jovo-model-nlpjs/src/Interfaces.ts @@ -16,5 +16,5 @@ export interface NlpjsModelFile { name: string; locale: string; data: NlpjsData[]; - entities?: Record; + entities?: Record; } diff --git a/packages/jovo-model-nlpjs/src/JovoModelNlpjs.ts b/packages/jovo-model-nlpjs/src/JovoModelNlpjs.ts index d6afc62..18c04e8 100644 --- a/packages/jovo-model-nlpjs/src/JovoModelNlpjs.ts +++ b/packages/jovo-model-nlpjs/src/JovoModelNlpjs.ts @@ -8,6 +8,8 @@ import { } from '@jovotech/model'; import { NlpjsData, NlpjsModelFile } from '.'; +const REGEX_PREFIX = 'regex:'; + export class JovoModelNlpjs extends JovoModel { static MODEL_KEY = 'nlpjs'; @@ -87,6 +89,12 @@ export class JovoModelNlpjs extends JovoModel { if (JovoModelHelper.hasEntityTypes(model)) { returnData.entities = {}; for (const [entityKey, entityTypeName] of Object.entries(entitiesMap)) { + + if (entityTypeName.startsWith(REGEX_PREFIX)) { + returnData.entities![entityKey] = entityTypeName.slice(REGEX_PREFIX.length); + continue; + } + const relatedEntityType = JovoModelHelper.getEntityTypeByName(model, entityTypeName); if (!relatedEntityType?.values?.length) { continue;