From 808f33b5a127fde7a8f47f83fa1ae4d3ba9ad98e Mon Sep 17 00:00:00 2001 From: MohamedAliBouhaouala Date: Fri, 25 Apr 2025 11:12:35 +0100 Subject: [PATCH] fix: restore old files --- api/src/chat/services/block.service.ts | 17 ++++++++--------- api/src/nlp/nlp.module.ts | 1 - 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/api/src/chat/services/block.service.ts b/api/src/chat/services/block.service.ts index 0f5578af..8e6402bd 100644 --- a/api/src/chat/services/block.service.ts +++ b/api/src/chat/services/block.service.ts @@ -200,16 +200,15 @@ export class BlockService extends BaseService< // This ensures that only blocks with valid matches are kept, and blocks with no matches are excluded, // all while iterating through the list only once. - const matchesWithPatterns = filteredBlocks.reduce< - NlpPatternMatchResult[] - >((acc, b) => { - const matchedPattern = this.matchNLP(nlp, b); + const matchesWithPatterns: NlpPatternMatchResult[] = + filteredBlocks.reduce((acc, b) => { + const matchedPattern = this.matchNLP(nlp, b); - if (matchedPattern && matchedPattern.length > 0) { - acc.push({ block: b, matchedPattern }); - } - return acc; - }, []); + if (matchedPattern && matchedPattern.length > 0) { + acc.push({ block: b, matchedPattern }); + } + return acc; + }, []); // Log the matched patterns this.logger.debug( diff --git a/api/src/nlp/nlp.module.ts b/api/src/nlp/nlp.module.ts index 1fba783f..4c783bd8 100644 --- a/api/src/nlp/nlp.module.ts +++ b/api/src/nlp/nlp.module.ts @@ -31,7 +31,6 @@ import { NlpSampleService } from './services/nlp-sample.service'; import { NlpValueService } from './services/nlp-value.service'; import { NlpService } from './services/nlp.service'; -// @Global() @Module({ imports: [ MongooseModule.forFeature([