From 54d84f684ed180987c8a967558722750f0c51626 Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Wed, 9 Oct 2024 10:15:22 +0100 Subject: [PATCH] fix: nlu helper init --- api/src/nlp/services/nlp.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/src/nlp/services/nlp.service.ts b/api/src/nlp/services/nlp.service.ts index c67a3745..fa7fb6d7 100644 --- a/api/src/nlp/services/nlp.service.ts +++ b/api/src/nlp/services/nlp.service.ts @@ -6,7 +6,7 @@ * 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file). */ -import { Injectable } from '@nestjs/common'; +import { Injectable, OnApplicationBootstrap } from '@nestjs/common'; import { OnEvent } from '@nestjs/event-emitter'; import { LoggerService } from '@/logger/logger.service'; @@ -20,7 +20,7 @@ import { NlpEntity } from '../schemas/nlp-entity.schema'; import { NlpValue } from '../schemas/nlp-value.schema'; @Injectable() -export class NlpService { +export class NlpService implements OnApplicationBootstrap { private registry: Map = new Map(); private nlp: BaseNlpHelper; @@ -31,7 +31,9 @@ export class NlpService { protected readonly nlpSampleService: NlpSampleService, protected readonly nlpEntityService: NlpEntityService, protected readonly nlpValueService: NlpValueService, - ) { + ) {} + + onApplicationBootstrap() { this.initNLP(); }