From 0243c71740936b616dcfe0a12372b7cfaff90dfc Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Thu, 23 Jan 2025 17:14:40 +0100 Subject: [PATCH 1/2] fix: nlu format return --- api/src/helper/lib/base-nlp-helper.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/src/helper/lib/base-nlp-helper.ts b/api/src/helper/lib/base-nlp-helper.ts index 02c30863..c88ed6cf 100644 --- a/api/src/helper/lib/base-nlp-helper.ts +++ b/api/src/helper/lib/base-nlp-helper.ts @@ -1,5 +1,5 @@ /* - * Copyright © 2024 Hexastack. All rights reserved. + * Copyright © 2025 Hexastack. All rights reserved. * * Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms: * 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission. @@ -120,7 +120,10 @@ export default abstract class BaseNlpHelper< * * @returns The formatted NLP training set */ - async format(samples: NlpSampleFull[], entities: NlpEntityFull[]) { + async format( + samples: NlpSampleFull[], + entities: NlpEntityFull[], + ): Promise[]> { const entityMap = NlpEntity.getEntityMap(entities); const valueMap = NlpValue.getValueMap( NlpValue.getValuesFromEntities(entities), From 43d63cfa82e5293418c848689302300891ddbeef Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Thu, 23 Jan 2025 18:21:35 +0100 Subject: [PATCH 2/2] fix: return type --- api/src/helper/lib/base-nlp-helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/helper/lib/base-nlp-helper.ts b/api/src/helper/lib/base-nlp-helper.ts index c88ed6cf..5b0e8310 100644 --- a/api/src/helper/lib/base-nlp-helper.ts +++ b/api/src/helper/lib/base-nlp-helper.ts @@ -123,7 +123,7 @@ export default abstract class BaseNlpHelper< async format( samples: NlpSampleFull[], entities: NlpEntityFull[], - ): Promise[]> { + ): Promise[] | Record> { const entityMap = NlpEntity.getEntityMap(entities); const valueMap = NlpValue.getValueMap( NlpValue.getValuesFromEntities(entities),