Skip to content

Commit

Permalink
🔀 Merge pull request #95 from jovotech/v4/dev
Browse files Browse the repository at this point in the history
🔖 Prepare latest release
  • Loading branch information
jankoenig authored Jan 31, 2024
2 parents b2ad305 + 0c0c51d commit 246e1a3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/jovo-model-alexa/src/JovoModelAlexa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/jovo-model-nlpjs/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export interface NlpjsModelFile {
name: string;
locale: string;
data: NlpjsData[];
entities?: Record<string, NlpjsEntity>;
entities?: Record<string, NlpjsEntity | string>;
}
8 changes: 8 additions & 0 deletions packages/jovo-model-nlpjs/src/JovoModelNlpjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 246e1a3

Please sign in to comment.