fix: nlu format return

This commit is contained in:
Mohamed Marrouchi 2025-01-23 17:14:40 +01:00
parent af7b8e7204
commit 0243c71740

View File

@ -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<Record<string, any>[]> {
const entityMap = NlpEntity.getEntityMap(entities);
const valueMap = NlpValue.getValueMap(
NlpValue.getValuesFromEntities(entities),